-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: add rollbacking logic for column type change #19531
*: add rollbacking logic for column type change #19531
Conversation
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.
LGTM
/run-unit-test |
1 similar comment
/run-unit-test |
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
13e48f3
to
44347e6
Compare
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/build |
Signed-off-by: AilinKid <314806019@qq.com>
/run-unit-test |
/run-common-test |
/merge |
/run-all-tests |
@AilinKid merge failed. |
/run-all-tests |
/run-common-test |
/run-integration-common-test |
/run-tics-test |
/run-all-tests |
/run-integration-common-test |
/run-unit-test |
3 similar comments
/run-unit-test |
/run-unit-test |
/run-unit-test |
/merge |
/run-all-tests |
/run-all-tests |
1 similar comment
/run-all-tests |
@AilinKid merge failed. |
/run-unit-test |
/merge |
/run-all-tests |
@AilinKid merge failed. |
/run-all-tests |
What problem does this PR solve?
Since #19059 has supported the column type change between integers.
This PR is to support rollbacking modify column job at four states including
StateNone
,StateDeleteOnly
,StateWriteOnly
,StateWriteReorganization
.Close issue: #19119
What is changed and how it works?
How it Works:
The column type change is implemented by appending an additional column and indexes into meta in the middle state. When reorganization is finished in
StateWriteReorganization
state, TiDB will substitute the old ones with these additional columns and indexes. These additional columns and indexes are named aschangingCol
andchangingIndexes
in our proposal.Because of this, rolling back modify column jobs in the middle state is much easier than other DDL jobs. At any one of the middle states, we can directly remove those
changingCol
andchangingIndex
from meta. Next, we should restore some flag in the field type of the old column likePreventNullInsertFlag
. Last, don't forget to add the index table into the delete range table.Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Release note