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

Fix apply retention issue #5342

Merged

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
We have MarkPhaseStarted and MarkPhaseEnded calls to notify retention and deletion expiry checker about start/end of chunk mark phase before applying retention. When MarkPhaseStarted is called on the deletion expiry checker, it would load all the delete requests to process and MarkPhaseEnded would mark those delete requests as processed.

We recently added a config to run mark phase at a different interval than compaction interval so it means we do not always apply retention when running compaction, based on the config. The bug here we have is we were always calling MarkPhaseStarted and MarkPhaseEnded which was causing the delete requests to be marked as processed even without processing them.

This also fixes another bug in the consolidated IntervalMayHaveExpiredChunks which was not passing userID to downstream retention and deletion expiry checker.

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@sandeepsukhani sandeepsukhani merged commit e4d6767 into grafana:main Feb 8, 2022
sandeepsukhani added a commit that referenced this pull request Feb 10, 2022
* call mark phase started/finished only when applying retention

* correctly pass userID to IntervalMayHaveExpiredChunks call on retention and dletion expiry check
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.

2 participants