This commit is contained in:
Bojan Serafimov
2022-12-12 14:00:04 -05:00
parent 0de1ec14e0
commit e0f23242be
2 changed files with 5 additions and 0 deletions

View File

@@ -429,6 +429,9 @@ impl LayerMap {
/// This should be called when the corresponding file on disk has been deleted.
///
pub fn remove_historic(&mut self, layer: Arc<dyn Layer>) {
// TODO remve from self.index and self.images
if layer.get_key_range() == (Key::MIN..Key::MAX) {
let len_before = self.l0_delta_layers.len();

View File

@@ -2298,6 +2298,7 @@ impl Timeline {
l.delete()?;
layers.remove_historic(l);
}
layers.rebuild_index();
drop(layers);
// Also schedule the deletions in remote storage
@@ -2594,6 +2595,7 @@ impl Timeline {
layers.remove_historic(doomed_layer);
result.layers_removed += 1;
}
layers.rebuild_index();
info!(
"GC completed removing {} layers, cutoff {}",