-
Notifications
You must be signed in to change notification settings - Fork 569
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
Store-gateway: allow postings scans to be interrupted #8154
Conversation
If the filter operation is expensive, e.g. a large regexp, and the posting has a lot of values, filtering can many seconds. Check the context for cancellation every 1024 values. Signed-off-by: Bryan Boreham <[email protected]>
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.
Looks good, I'd suggest to add some unit tests.
for d.Err() == nil && !currEntry.isLast { | ||
if count%checkContextEveryNIterations == 0 && ctx.Err() != nil { | ||
return nil, ctx.Err() |
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.
can we wrap the error so we have a bit more details? Also using context.Cause
instead of ctx.Err()
would give even more details
…ancel Signed-off-by: György Krajcsovits <[email protected]>
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 minor comments. It'd be nice to implement @dimitarvdimitrov 's
suggestions but I understand this is urgent-ish.
Signed-off-by: György Krajcsovits <[email protected]>
* Store-gateway: allow postings scans to be interrupted If the filter operation is expensive, e.g. a large regexp, and the posting has a lot of values, filtering can many seconds. Check the context for cancellation every 1024 values. Signed-off-by: Bryan Boreham <[email protected]> Signed-off-by: György Krajcsovits <[email protected]> Co-authored-by: György Krajcsovits <[email protected]> Co-authored-by: George Krajcsovits <[email protected]>
What this PR does
If the filter operation is expensive, e.g. a large regexp, and the posting has a lot of values, filtering can many seconds. Check the context for cancellation every 1024 values.
Which issue(s) this PR fixes or relates to
Same issue as grafana/mimir-prometheus#633, but store-gateway does its own index scans.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.