Unknown tables cannot be copied without their types. Dropping an empty one loses nothing, and retired tables are no longer read; any other table must stop the merge. Returns the non-empty retired tables left behind.
(
txn: &ReadTransaction,
known: &BTreeSet<String>,
source: &Path,
)
| 229 | /// loses nothing, and retired tables are no longer read; any other table must |
| 230 | /// stop the merge. Returns the non-empty retired tables left behind. |
| 231 | fn refuse_unknown_tables( |
| 232 | txn: &ReadTransaction, |
| 233 | known: &BTreeSet<String>, |
| 234 | source: &Path, |
| 235 | ) -> PristineResult<Vec<String>> { |
| 236 | let mut non_empty = Vec::new(); |
| 237 | for handle in txn.list_tables()? { |
| 238 | let name = handle.name().to_string(); |
| 239 | if !known.contains(name.as_str()) && txn.open_untyped_table(handle)?.len()? > 0 { |
| 240 | non_empty.push(name); |
| 241 | } |
| 242 | } |
| 243 | for handle in txn.list_multimap_tables()? { |
| 244 | let name = handle.name().to_string(); |
| 245 | if !known.contains(name.as_str()) && txn.open_untyped_multimap_table(handle)?.len()? > 0 { |
| 246 | non_empty.push(name); |
| 247 | } |
| 248 | } |
| 249 | let (left_behind, unknown): (Vec<_>, Vec<_>) = non_empty |
| 250 | .into_iter() |
| 251 | .partition(|name| RETIRED_TABLES.contains(&name.as_str())); |
| 252 | if unknown.is_empty() { |
| 253 | return Ok(left_behind); |
| 254 | } |
| 255 | Err(merge_error(format!( |
| 256 | "{} holds tables this atomic does not know ({}); upgrade atomic before opening this repository", |
| 257 | source.display(), |
| 258 | unknown.join(", ") |
| 259 | ))) |
| 260 | } |
| 261 | |
| 262 | #[derive(Default)] |
| 263 | struct DigestBuilder { |