handle name conflict

Signed-off-by: Alex Chi Z <chi@neon.tech>
This commit is contained in:
Alex Chi Z
2023-07-05 16:26:02 -04:00
parent a079d250d9
commit 7e7cdaa3eb

View File

@@ -4465,9 +4465,18 @@ impl Timeline {
}
}
let new_layers_key = new_layers
.iter()
.map(|x| x.layer_desc().key())
.collect::<HashSet<_>>();
for layer in layers_to_delete {
layer_names_to_delete.push(layer.filename());
self.delete_historic_layer_new(layer_removal_cs.clone(), layer, &mut updates)?;
if !new_layers_key.contains(&layer.key()) {
layer_names_to_delete.push(layer.filename());
self.delete_historic_layer_new(layer_removal_cs.clone(), layer, &mut updates)?;
} else {
updates.remove_historic_new((*layer).clone());
}
}
let new_tier_at_index = new_tier_at_index.unwrap();