mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 06:52:55 +00:00
Only use active timelines in synthetic_size calculation
This commit is contained in:
@@ -134,7 +134,7 @@ pub(super) async fn gather_inputs(
|
||||
.context("Failed to refresh gc_info before gathering inputs")?;
|
||||
|
||||
// Collect information about all the timelines
|
||||
let timelines = tenant.list_timelines();
|
||||
let mut timelines = tenant.list_timelines();
|
||||
|
||||
if timelines.is_empty() {
|
||||
// perhaps the tenant has just been created, and as such doesn't have any data yet
|
||||
@@ -144,6 +144,13 @@ pub(super) async fn gather_inputs(
|
||||
});
|
||||
}
|
||||
|
||||
// Filter out timelines that are not active
|
||||
//
|
||||
// There may be a race when a timeline is dropped,
|
||||
// but it is unlikely to cause any issues. In the worst case,
|
||||
// the calculation will error out.
|
||||
timelines.retain(|t| t.is_active());
|
||||
|
||||
// Build a map of branch points.
|
||||
let mut branchpoints: HashMap<TimelineId, HashSet<Lsn>> = HashMap::new();
|
||||
for timeline in timelines.iter() {
|
||||
|
||||
Reference in New Issue
Block a user