-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Pass unique context and cancel func to worker during compaction #8588
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Anna Tran <[email protected]>
Signed-off-by: Anna Tran <[email protected]>
Signed-off-by: Anna Tran <[email protected]>
0782fdf to
3030034
Compare
GiedriusS
left a 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.
Why cannot whoever calls Plan() cancel the context when they need to cancel it?
| comp tsdb.Compactor | ||
| } | ||
|
|
||
| var cancelFn = func() {} |
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.
Could we please not add this? 🙏 let's pass func() {} instead where needed
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.
Yes I will fix this
This is also an option. We could make a new error |
Changes
This PR creates a new context for each compaction worker and also passes the cancel function for that worker's context. This allows a single compaction to be aborted/failed in case of an issue in the planning phase, and only affect that single compaction job.
The change will help to address this issue in Cortex: cortexproject/cortex#7135
Verification
Updated unit tests.
make buildruns successfully.