-
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
Avoid making delete requests when deletes are disabled for a user #6583
Avoid making delete requests when deletes are disabled for a user #6583
Conversation
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, just a nit
pkg/storage/stores/shipper/compactor/deletion/tenant_delete_requests_client.go
Show resolved
Hide resolved
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0.4% |
Is the enable/disable of the deletes for a tenant runtime reloadable? if not it might make more sense to have a |
It's just part of |
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, with a nit
pkg/storage/stores/shipper/compactor/deletion/tenant_delete_requests_client.go
Show resolved
Hide resolved
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
(cherry picked from commit a92e048)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-6583-to-release-2.6.x origin/release-2.6.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x a92e048ec31148fa709e85dfd700f4cf5f58b8b0
# Push it to GitHub
git push --set-upstream origin backport-6583-to-release-2.6.x
git switch main
# Remove the local backport branch
git branch -D backport-6583-to-release-2.6.x Then, create a pull request where the |
(cherry picked from commit a92e048)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-6583-to-release-2.6.x origin/release-2.6.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x a92e048ec31148fa709e85dfd700f4cf5f58b8b0
# Push it to GitHub
git push --set-upstream origin backport-6583-to-release-2.6.x
git switch main
# Remove the local backport branch
git branch -D backport-6583-to-release-2.6.x Then, create a pull request where the |
func (c *perTenantDeleteRequestsClient) GetAllDeleteRequestsForUser(ctx context.Context, userID string) ([]DeleteRequest, error) { | ||
allLimits := c.limits.AllByUserID() | ||
userLimits, ok := allLimits[userID] | ||
if ok && userLimits.CompactorDeletionEnabled || c.limits.DefaultLimits().CompactorDeletionEnabled { |
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.
@MasslessParticle it looks like if we have CompactorDeletionEnabled=true
in defaultLimits then even if we disable deletion for this particular tenant, it will be ignored and deletion will be processed.
Originally, when deletes were disabled, the querier didn't make a request at all. This change emulates that and only makes delete requests for tenants who have deletes enabled.