-
Notifications
You must be signed in to change notification settings - Fork 823
Avoid large blocks on forced compaction of blocks ingester #3344
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 large blocks on forced compaction of blocks ingester #3344
Conversation
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
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.
Thanks @codesome ! Good work, LGTM. I left few minor comments, mostly design. I would also be glad if you could add a unit test: we already have TestIngester_flushing
and, if I'm not missing anything, could be easy to add another test case where you push samples spanning over different days and make sure it generates 2 output blocks.
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
PR is ready for another review. I have added a unit test and refactored the code as discussed. |
3071f3b
to
b76dda5
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
b76dda5
to
e11b137
Compare
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 some nits.
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Based on offline discussion with @codesome, I've removed compaction mutex, since it's not needed. Additionally, I've replaced |
|
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! This is more robust against what Peter mentioned above. Ignore my previous comment.
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.
Good job! LGTM, thanks! I just left a couple of minor nits.
}, | ||
|
||
action: func(t *testing.T, i *Ingester, m *shipperMock) { | ||
// Pushing 5 samples, spanning over 3 days. |
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.
spanning over 3 days
Aren't they over 2 days? However I believe the test would be even stronger if samples would span 3 days and you would expect 3 blocks in output.
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.
However I believe the test would be even stronger if samples would span 3 days and you would expect 3 blocks in output.
It will depend on the actual samples, because by default it will try to create 2h blocks and not over a day. So a test of creating smaller blocks + breaking the block when it spans 2 day might be fine. I will update the test and maybe have 3 days itself anyway.
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
What this PR does:
Creates smaller blocks out of Head during idle and forced compaction.
Which issue(s) this PR fixes:
Fixes #3308
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]