Filter only active timelines for compaction (#4487)

Previously we may've included Stopping/Broken timelines here, which
leads to errors in logs -> causes tests to sporadically fail

resolves #4467
This commit is contained in:
Dmitry Rodionov
2023-06-14 19:07:42 +03:00
committed by GitHub
parent 9484b96d7c
commit ee9a5bae43

View File

@@ -1462,7 +1462,13 @@ impl Tenant {
let timelines = self.timelines.lock().unwrap();
let timelines_to_compact = timelines
.iter()
.map(|(timeline_id, timeline)| (*timeline_id, timeline.clone()))
.filter_map(|(timeline_id, timeline)| {
if timeline.is_active() {
Some((*timeline_id, timeline.clone()))
} else {
None
}
})
.collect::<Vec<_>>();
drop(timelines);
timelines_to_compact