*: add read-first DDL framework notes#66094
*: add read-first DDL framework notes#66094wjhuang2016 wants to merge 4 commits intopingcap:masterfrom
Conversation
|
❌ Request Failed The system couldn’t send or save your message because it’s missing the information that identifies which user it belongs to. Please try again after signing in or making sure your account is selected. Please try again or contact support if the issue persists.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
lance6716
left a comment
There was a problem hiding this comment.
Very helpful! (will help to comment soon)
|
|
||
| - End the previous transaction and start a new internal DDL transaction context. | ||
| - Perform statement-level branching (AST switch) and call `ddl.Executor` methods. | ||
| - Convert “schema outdated” errors into `ErrInfoSchemaChanged` so the caller can retry safely (`(*DDLExec).toErr`). |
There was a problem hiding this comment.
How about removing this line? Error path is less important than other main logic
There was a problem hiding this comment.
I don't verify the whole context for now; it still needs further verification
| Entry: `pkg/executor/ddl.go` (`type DDLExec`, `(*DDLExec).Next`) | ||
|
|
||
| Responsibilities: | ||
|
|
There was a problem hiding this comment.
I'm not sure if my impression helps 😂
Acts as the SQL abstraction layer that wraps internal distributed DDL module for end-user interaction. Runs on the TiDB node that user connected.
| - Persisting schema changes directly (should go through DDL jobs). | ||
| - Any logic that must survive owner transfer / restart (belongs to job execution). | ||
|
|
||
| ## 2) DDL executor (DDL module): statement → job(s) → wait |
There was a problem hiding this comment.
The entry point for distributed DDL tasks. Acts as a framework client responsible for verification, serialization, and blocking wait. Runs on the TiDB node that user connected.
What problem does this PR solve?
Issue Number: close #66093
Problem Summary:
pkg/executor/without understanding the job-based, owner-driven execution pipeline.What changed and how does it work?
docs/note/ddl/with an index + reading order, covering execution flow, job lifecycle, reorg/backfill pointers, a dev checklist, and a file map.AGENTS.mdwith DDL module-only rules:Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.