-
Notifications
You must be signed in to change notification settings - Fork 131
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
Fix affect of online DDL #466
Conversation
see issue pingcap/tidb#9304 we drop the truncated table dml data.
4a87b16
to
6b29d3b
Compare
respect |
has add the Integration test for other ddl case test, no integration test when write |
Co-Authored-By: july2993 <july2993@gmail.com>
Co-Authored-By: july2993 <july2993@gmail.com>
Rest LGTM |
use zero value for not null
@GregoryIan @WangXiangUSTC PTAL |
/rebuild |
/run-all-tests |
LGTM |
// TiDB write DDL Binlog for every DDL Job, we must ignore jobs that are cancelled or rollback | ||
// For older version TiDB, it write DDL Binlog in the txn that the state of job is changed to *synced* | ||
// Now, it write DDL Binlog in the txn that the state of job is changed to *done* (before change to *synced*) | ||
// At state *done*, it will be always and only changed to *synced*. | ||
func skipJob(job *model.Job) bool { |
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.
@WangXiangUSTC @GregoryIan
if upgrade to TiDB with the write ddl binlog when change state to done, must upgrade drainer too, or may there's risk losing ddl event(skip here because it's still at done state)
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.
send an email to business team @july2993
return types.NewDatum(col.DefaultValue) | ||
} | ||
|
||
if col.Tp == mysql.TypeEnum { |
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.
seems table.GetZeroValue have already handle the mysql.TypeEnum.
Or you need handle the mysql.TypeSet too.
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.
in GetZeroValue will get a zero value for enum, this is not a valid value for Enum, but for set
a empty set is a valid value.this is some kind like https://github.com/pingcap/tidb/blob/9da174902af4005d7d3951d09cd5b9cd648d392c/table/column.go#L388
also you can take a look at https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
LGTM @crazycs520 PTAL |
see issue pingcap/tidb#9304 skip the truncated table DML data. refactor some translator code in ./drainer add some ddl test case change tests/run.sh to be easy start multi instance TiDB for test
see issue pingcap/tidb#9304 skip the truncated table DML data. refactor some translator code in ./drainer add some ddl test case change tests/run.sh to be easy start multi instance TiDB for test
see issue pingcap/tidb#9304 skip the truncated table DML data. refactor some translator code in ./drainer add some ddl test case change tests/run.sh to be easy start multi instance TiDB for test
What problem does this PR solve?
see https://internal.pingcap.net/jira/browse/TOOL-906
should update drainer if upgrade TiDB to version with pingcap/tidb#9207 merged
What is changed and how it works?
skip the truncated table DML data.
refactor some translator code in ./drainer
add some ddl test case
change tests/run.sh to be easy start multi instance TiDB for test
currently only handle the truncate table case, other DDL should take no effect.
Check List
Tests
Code changes
Related changes