-
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
ddl: delay before changing column from null to not null #23364
Conversation
75dd84e
to
92112f7
Compare
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
92112f7
to
105a8a2
Compare
/lgtm |
// delayForAsyncCommit sleeps `SafeWindow + AllowedClockDrift` before a DDL job finishes. | ||
// It should be called before any DDL that could break data consistency. | ||
// This provides a safe window for async commit and 1PC to commit with an old schema. | ||
func delayForAsyncCommit() { |
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.
Do we need to check 1PC here?
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.
1PC works in the same way with async commit.
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.
"sleep before DDL finishes to make async commit safe" is not accurate?
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.
OK. I just change the log without changing the function name. It looks too verbose to also put 1PC to the name
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
…null Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@AilinKid @wjhuang2016 PTAL |
/lgtm |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 0b0492d
|
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.
Rest LGTM
go.sum
Outdated
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= | ||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= | ||
cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= | ||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= | ||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= | ||
cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE= | ||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= |
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.
go.sum should be changed?
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
/lgtm |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 855dade
|
Unit test fails due to a reported race: #23280 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #23424 |
* ddl: delay before changing column from null to not null Signed-off-by: Yilin Chen <sticnarf@gmail.com> Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com> Co-authored-by: Arenatlx <314806019@qq.com>
What problem does this PR solve?
Issue Number: close #23363
What is changed and how it works?
Before the double check of changing null to not null, we should delay like the reorg to make async commit safe.
After the delay, if an async commit writes a NULL, the double null check must detect it.
Check List
Tests
Release note