-
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]>
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?
This is also an option. We could make a new error |
Signed-off-by: Anna Tran <[email protected]>
bc1ed66 to
6543a18
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.
Could you show changes on the Cortex side? I don't get why we need to pass the cancel function.
|
I added a comment regarding how this would work in Cortex, and will update that with proposed code changes. |
6543a18 to
7591b1a
Compare
Signed-off-by: Anna Tran <[email protected]>
7591b1a to
f9c9564
Compare
Signed-off-by: Anna Tran <[email protected]>
Changes
This PR creates a new context for each compaction worker and also passes the cancel function for that worker's context. It introduces a new monitoring function in the lifecycle callback that allows implementations of the lifecycle to cancel the context if there is any issue with the compaction plan/process while the compaction is underway.
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
make buildruns successfully.