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

refine the context and context-like struct usage in DDL #56398

Open
Tracked by #54436
lance6716 opened this issue Sep 29, 2024 · 2 comments
Open
Tracked by #54436

refine the context and context-like struct usage in DDL #56398

lance6716 opened this issue Sep 29, 2024 · 2 comments
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@lance6716
Copy link
Contributor

lance6716 commented Sep 29, 2024

Enhancement

Currently the context usage is a bit of messy. One problem is #56017 and I think a better context usage and cancellation will solve it. After a simple review of current DDL code, I think there should to 2 types of context:

  1. the context of a DDL job. All job execution logic should use this context. And another goroutine polling the job state should cancel the context if it's not JobStateRunning.
  2. the context of DDL module. Job rollingback, canceling, cleanup, scheduling, execution and other module-level action should use this context. It's canceled when the parent context is canceled which means domain is closing.
@lance6716 lance6716 added the type/enhancement The issue or PR belongs to an enhancement. label Sep 29, 2024
@lance6716
Copy link
Contributor Author

@D3Hunter please help link this issue to #54436 in a proper task

@D3Hunter
Copy link
Contributor

And another goroutine polling the job state should cancel the context if it's not JobStateRunning.

some general jobs like create-table go directly from queuing -> done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants