diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index 2c19e7eb6e..d6b35d39d2 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -3958,7 +3958,7 @@ impl Timeline { } guard.finish_compact_l0( - layer_removal_cs, + &layer_removal_cs, remove_layers, insert_layers, &self.metrics, @@ -4295,7 +4295,7 @@ impl Timeline { layer_names_to_delete.push(doomed_layer.filename()); result.layers_removed += 1; } - let apply = guard.finish_gc_timeline(layer_removal_cs, gc_layers, &self.metrics)?; + let apply = guard.finish_gc_timeline(&layer_removal_cs, gc_layers, &self.metrics)?; if result.layers_removed != 0 { fail_point!("after-timeline-gc-removed-layers"); diff --git a/pageserver/src/tenant/timeline/layer_manager.rs b/pageserver/src/tenant/timeline/layer_manager.rs index 25df8a4f52..08cdb81080 100644 --- a/pageserver/src/tenant/timeline/layer_manager.rs +++ b/pageserver/src/tenant/timeline/layer_manager.rs @@ -210,7 +210,7 @@ impl LayerManager { /// Called when compaction is completed. pub(crate) fn finish_compact_l0( &mut self, - layer_removal_cs: Arc>, + layer_removal_cs: &Arc>, compact_from: Vec>, compact_to: Vec>, metrics: &TimelineMetrics, @@ -224,7 +224,7 @@ impl LayerManager { // in the LayerFileManager because compaction kept holding `layer_removal_cs` the entire // time, even though we dropped `Timeline::layers` inbetween. Self::delete_historic_layer( - layer_removal_cs.clone(), + &layer_removal_cs, l, &mut updates, metrics, @@ -238,14 +238,14 @@ impl LayerManager { /// Called when garbage collect the timeline. Returns a guard that will apply the updates to the layer map. pub(crate) fn finish_gc_timeline( &mut self, - layer_removal_cs: Arc>, + layer_removal_cs: &Arc>, gc_layers: Vec>, metrics: &TimelineMetrics, ) -> Result { let mut updates = self.layer_map.batch_update(); for doomed_layer in gc_layers { Self::delete_historic_layer( - layer_removal_cs.clone(), + layer_removal_cs, doomed_layer, &mut updates, metrics, @@ -279,7 +279,7 @@ impl LayerManager { /// Remote storage is not affected by this operation. fn delete_historic_layer( // we cannot remove layers otherwise, since gc and compaction will race - _layer_removal_cs: Arc>, + _layer_removal_cs: &Arc>, layer: Arc, updates: &mut BatchedUpdates<'_>, metrics: &TimelineMetrics,