From 32d14403bd6ab4f4520a94cbfd81a6acef7a526c Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Mon, 31 Oct 2022 18:17:38 +0200 Subject: [PATCH] remove wrong is_active filter for timelines in compaction/gc Gc needs to know about all branch points, not only ones for timelines that are active at the moment of gc. If timeline is inactive then we wont know about branch point. In this case gc can delete data that is needed by child timeline. For compaction it is less severe. Delaying compaction can cause an effect on performance. So it is still better to run it. There is a logic to exit it quickly if there is nothing to compact --- pageserver/src/tenant.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 84833e9c40..ed9d2e8c7a 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -523,7 +523,6 @@ impl Tenant { let timelines = self.timelines.lock().unwrap(); let timelines_to_compact = timelines .iter() - .filter(|(_, timeline)| timeline.is_active()) .map(|(timeline_id, timeline)| (*timeline_id, timeline.clone())) .collect::>(); drop(timelines); @@ -995,7 +994,6 @@ impl Tenant { timelines .iter() - .filter(|(_, timeline)| timeline.is_active()) .map(|(timeline_id, timeline_entry)| { // This is unresolved question for now, how to do gc in presence of remote timelines // especially when this is combined with branching.