Skip to content

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

@lance6716

Description

@lance6716

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions