-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Logs deletion support for boltdb-shipper store #3688
Merged
sandeepsukhani
merged 13 commits into
grafana:main
from
sandeepsukhani:deletion-boltdb-shipper
May 18, 2021
Merged
Logs deletion support for boltdb-shipper store #3688
sandeepsukhani
merged 13 commits into
grafana:main
from
sandeepsukhani:deletion-boltdb-shipper
May 18, 2021
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
sandeepsukhani
force-pushed
the
deletion-boltdb-shipper
branch
3 times, most recently
from
May 6, 2021 06:01
7dbec90
to
d9216d5
Compare
cyriltovena
reviewed
May 6, 2021
pkg/storage/stores/shipper/compactor/deletion/delete_request.go
Outdated
Show resolved
Hide resolved
cyriltovena
reviewed
May 6, 2021
cyriltovena
reviewed
May 6, 2021
pkg/storage/stores/shipper/compactor/deletion/delete_requests_manager.go
Outdated
Show resolved
Hide resolved
cyriltovena
reviewed
May 6, 2021
… on delete requests
sandeepsukhani
force-pushed
the
deletion-boltdb-shipper
branch
from
May 11, 2021 13:14
151e41a
to
5429d7f
Compare
cyriltovena
approved these changes
May 17, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I'd appreciate if you could grab the userID without allocation, when deleting millions of chunks it might slow everything down.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
This PR leverages existing code for retention to support deletion for
boltdb-shipper
.It relies on the Mark phase of retention which now also looks at eligible delete requests by talking to
DeleteRequestsManager
to decide whether the chunk is supposed to be deleted or not. For partially deleted chunks I have added a chunk rewriter which would build chunks for the interval for which they are not deleted and writes them to the store. A successful Mark process over all the tables considers delete requests as processed and the relevant chunk should be deleted later by the Sweep process.The delete requests are persisted in a table called
delete_requests
which is a boltdb file. The file is uploaded to the object store every 5 mins or during shutdown and is downloaded locally if it does not exist during startup.Here is how deletion would roughly work:
MarkPhaseStarted
ofDeleteRequestsManager
before starting the compaction which would load eligible delete requests in memory.MarkPhaseFinished
after successful compaction of all the tables which would mark the in-memory requests as processed.MarkPhaseFailed
if any of the tables fails to compact which would just drop requests from memory.Checklist