Skip to content
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

Only consider an interval to have possible expired chunks if it overlaps a delete. #6297

Conversation

MasslessParticle
Copy link
Contributor

Before, we considered any interval to potentially have an expired chunk if the passed userID matched a user on a DeleteRequest. This PR adds the requirement that an interval must also overlap a delete request to count as having a potential expired chunk.

@MasslessParticle MasslessParticle requested a review from a team as a code owner June 2, 2022 21:02
@grafanabot
Copy link
Collaborator

./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.7%

Copy link
Collaborator

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

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

Looks good, just one small question about the "overlap" logic.

d.deleteRequestsToProcessMtx.Lock()
defer d.deleteRequestsToProcessMtx.Unlock()

if userID != "" {
for _, deleteRequest := range d.deleteRequestsToProcess {
if deleteRequest.UserID == userID {
if deleteRequest.UserID == userID &&
deleteRequest.StartTime <= interval.End &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

In your comment on the PR you mention if an interval overlaps a delete request, but this logic requires the interval to be fully within the delete request time period (so excluding an overlap at the start or end of the interval). Is that intended? Would there be a situation where we'd want an || here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually handles overlaps because any overlapping interval will always start before the end of the delete and end after the start of the delete. Fully overlapping is just a special case. I've included a picture

Untitled-2022-05-25-1713

Copy link
Collaborator

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

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

That illustration helped a bunch, thanks! LGTM!

Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants