Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pageserver: use proper GC cutoffs at external interfaces #10707

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jcsp
Copy link
Collaborator

@jcsp jcsp commented Feb 6, 2025

Problem

We validate branch creations against both the latest_gc_cutoff (the one we've applied) and the planned GC cutoff (the projection of PITR time onto LSN space).

However, in our external interfaces we were using only the latest_gc_cutoff, so a caller who looks up an LSN with get_lsn_by_timestamp might get an unusable LSN, or someone who looks at TimelineInfo output might also get an unusable LSN.

Closes: #10639

Summary of changes

  • Use max() of GC lsns in TimelineInfo
  • Use max() of GC lsns when bounding timestamp lookup

@jcsp jcsp changed the title Jcsp/issue 10639 gc cutoffs pageserver: use proper GC cutoffs at external interfaces Feb 6, 2025
@jcsp jcsp added t/bug Issue Type: Bug c/storage/pageserver Component: storage: pageserver labels Feb 6, 2025
@jcsp jcsp requested review from skyzh and arpad-m February 6, 2025 17:23
@@ -616,7 +616,10 @@ impl Timeline {
// GC cutoff could be before the branching point and we cannot create a new branch
// with LSN < `ancestor_lsn`. Thus, pick the maximum of these two to be
// on the safe side.
let min_lsn = std::cmp::max(*gc_cutoff_lsn_guard, self.get_ancestor_lsn());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a rebase (cc #10678)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/storage/pageserver Component: storage: pageserver t/bug Issue Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

planned GC horizon issue with timestamp->lsn API and timeline creation
2 participants