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
scrubber: add separate find/purge garbage commands #5409
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jcsp
added
t/feature
Issue type: feature, for new features or requests
c/storage/pageserver
Component: storage: pageserver
labels
Sep 28, 2023
jcsp
force-pushed
the
jcsp/scrubber-garbage
branch
from
September 28, 2023 09:55
84f061d
to
6dc48c5
Compare
2340 tests run: 2225 passed, 0 failed, 115 skipped (full report)Code coverage (full report)
The comment gets automatically updated with the latest test results
8de421d at 2023-10-26T11:12:50.815Z :recycle: |
arpad-m
reviewed
Sep 28, 2023
Co-authored-by: Arpad Müller <arpad-m@users.noreply.github.com>
shanyp
approved these changes
Oct 26, 2023
Co-authored-by: Shany Pozin <shany@neon.tech>
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/feature
Issue type: feature, for new features or requests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The previous garbage cleanup functionality relied on doing a dry run, inspecting logs, and then doing a deletion. This isn't ideal, because what one actually deletes might not be the same as what one saw in the dry run. It's also risky UX to rely on presence/absence of one CLI flag to control deletion: ideally the deletion command should be totally separate from the one that scans the bucket.
Related: #5037
Summary of changes
This is a major re-work of the code, which results in a net decrease in line count of about 600. The old code for removing garbage was build around the idea of doing discovery and purging together: a "delete_batch_producer" sent batches into a deleter. The new code writes out both procedures separately, in functions that use the async streams introduced in #5176 to achieve fast concurrent access to S3 while retaining the readability of a single function.
find-garbage
, which writes out a JSON file of tenants/timelines to purgepurge-garbage
which consumes the garbage JSON file, applies some extra validations, and does deletions.Outstanding work for a future PR:
Modified
times for index_part.json files (not doing this here, because it will depend on the generation-aware changes for finding index_part.json files)Checklist before requesting a review
Checklist before merging