From 7b0d28bbdce81cf470800aa27ef239b47116380c Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 19 Dec 2022 21:09:41 +0200 Subject: [PATCH] Update outdated comment on Tenant::gc_iteration. Commit 6dec85b19d remove the `checkpoint_before_gc` argument, but failed to update the comment. Remove its description, and while we're at it, try to explain better how the `horizon` and `pitr` arguments are used. --- pageserver/src/tenant.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 64e214c5a2..edd7a3cb07 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -1154,11 +1154,15 @@ impl Tenant { /// this function is periodically called by gc task. /// also it can be explicitly requested through page server api 'do_gc' command. /// - /// 'target_timeline_id' specifies the timeline to GC, or None for all. - /// `horizon` specifies delta from last lsn to preserve all object versions (pitr interval). - /// `checkpoint_before_gc` parameter is used to force compaction of storage before GC - /// to make tests more deterministic. - /// TODO Do we still need it or we can call checkpoint explicitly in tests where needed? + /// `target_timeline_id` specifies the timeline to GC, or None for all. + /// + /// The `horizon` an `pitr` parameters determine how much WAL history needs to be retained. + /// Also known as the retention period, or the GC cutoff point. `horizon` specifies + /// the amount of history, as LSN difference from current latest LSN on each timeline. + /// `pitr` specifies the same as a time difference from the current time. The effective + /// GC cutoff point is determined conservatively by either `horizon` and `pitr`, whichever + /// requires more history to be retained. + // pub async fn gc_iteration( &self, target_timeline_id: Option,