Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@psFried
Copy link
Contributor

@psFried psFried commented Jan 23, 2024

Allows adding a "covering" segment to a SegmentSet. Given an non-empty set, this permits adding a segment that completely covers a subset of existing segments and has LastOffset: 0. This is needed in order to reduce backup and primary hints into the same set, which is needed by shards prune in order to prune recovery logs conservatively.

I realized that the other fix is truly not necessary, because the existing behavior of zeroing the final segment of each set of hints is retained, and serves the same purpose.

With this change, I'm able to successfully dry-run pruning all the shards in Estuary's production environment.


This change is Reviewable

@psFried psFried requested a review from jgraettinger January 23, 2024 17:42
Copy link
Contributor

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

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

LGTM, but can we also remove this ?

@psFried
Copy link
Contributor Author

psFried commented Jan 23, 2024

LGTM, but can we also remove this ?

I can update the comment, but my understanding is that the code to zero out the LastOffset is still required. The set prefers to keep a non-zero offset over a zero'd offset in certain cases, as shown by this test case. So I'm thinking we need to keep that code in order to guarantee the behavior that we don't prune any fragments after the greatest LastOffset from the earliest backup hints.

Allows adding a "covering" segment to a `SegmentSet`. Given an non-empty set,
this permits adding a segment that completely covers a subset of existing
segments and has `LastOffset: 0`.  This is needed in order to reduce backup and
primary hints into the same set, which is needed by `shards prune` in order to
prune recovery logs conservatively.
@psFried psFried force-pushed the phil/prune-bugfix-take-two branch from bb3ede9 to e650aed Compare January 23, 2024 21:23
@psFried psFried merged commit e2cace3 into master Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants