-
Notifications
You must be signed in to change notification settings - Fork 521
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
Implement tenant deletion for empty tenants #3611
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
zalegrala
commented
Apr 26, 2024
zalegrala
force-pushed
the
tenantDeletionRedux
branch
from
April 26, 2024 16:27
7134577
to
25ffa7c
Compare
zalegrala
changed the title
Implement tenant deletion for tenants which have no blocks
Implement tenant deletion for empty tenants
Apr 26, 2024
zalegrala
requested review from
knylander-grafana,
joe-elliott,
annanay25,
mdisibio,
mapno,
yvrhdn,
electron0zero,
ie-pham and
stoewer
as code owners
April 29, 2024 15:15
mdisibio
reviewed
May 1, 2024
mdisibio
approved these changes
May 2, 2024
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.
Nice work. Left a few more idle thoughts and responses, but nothing blocking.
Co-authored-by: Kim Nylander <[email protected]>
* Rename backend.FindOpts -> backend.FindMatch * Adjust default delete time from 20m -> 12h
zalegrala
force-pushed
the
tenantDeletionRedux
branch
from
May 3, 2024 17:34
2bc07c7
to
a32a6c8
Compare
joe-elliott
pushed a commit
to joe-elliott/tempo
that referenced
this pull request
May 7, 2024
* Extend backend.Reader with Find() function * Extend backend.Writer with Delete() function * Add EmptyTenantDeletion age config to tempodb * Add delete handling to poller * Add integration tests for poller change * Update backend implementations * Fix lint * Setup test defaults * Integrate prefix test permutations * Add doc for the new configuration option * Update changelog * Fix local implementation to ignore directories * Tidy up todo after test coverage * Update docs/sources/tempo/configuration/_index.md Co-authored-by: Kim Nylander <[email protected]> * Address some PR feedback * Rename backend.FindOpts -> backend.FindMatch * Adjust default delete time from 20m -> 12h * Add log message for object deletion * Add additional safety check to avoid deletion * Add test default value * Godoc update after rename * Drop logging from the backend used for testing * Require empty tenant deletion to be enabled in the config * Add docs for _enabled config --------- Co-authored-by: Kim Nylander <[email protected]>
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:
In previous attempts to delete the tenant index, it was possible that undiscoverable objects remained in the backend as a partial blocks, which lead to unintended behavior for the poller, whereby the poller would discover a tenant, determine there were no blocks, and delete the index. However, the partial blocks kept the tenant in the list and so would repeat this forever, or until bucket retention policies removed the objects.
Here we take a more complete approach to tenant deletion. Upon deletion of a tenant index, we search the backend for objects on a given tenant, and then delete them after a configurable amount of time has expired since the object was last modified.
EmptyTenantDeletionAge
, default to 4x the polling cycle, which will delete objects from empty tenants after this time has expired.Background Summary:
<tenant>/<blockID>/data.parquet
existsmeta.json
normeta.compacted.json
exist for this block./
to determine all the tenant “directory” names.Which issue(s) this PR fixes:
Related #2678
Related #2754
Related #2781
Fixes #2878
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]