-
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
Add sync mode config to allow mismatch column number #867
Conversation
when setting SyncPartialColumn will allow mismatch column number and relax sql mode by removing STRICT_TRANS_TABLES.
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
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.
Could you provide more context about this change? For example, when would the number of columns in downstream be different from the upstream.
@@ -55,6 +56,27 @@ func NewMysqlSyncer(cfg *DBConfig, tableInfoGetter translator.TableInfoGetter, w | |||
})) | |||
} | |||
|
|||
if cfg.SyncMode != 0 { | |||
mode := loader.SyncMode(cfg.SyncMode) |
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.
Can we make sure sqlMode
don't include STRICT_TRANS_TABLES
before creating db
?
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.
if sqlMode
is not configred we need to create db
first by checking the sql mode
default of the database.
description of pr updated |
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-all-tests |
allow when the column number of downstream table mismatch with current schema. For the case bidirectional replication, we will execute the DDL at one side, for add or drop column the column number will mismatch. cluster A <-> cluster B drop column of table t at cluster A some DML of table t at cluster B will miss the column dropped compared to cluster A
* Add sync mode config (#867) allow when the column number of downstream table mismatch with current schema. For the case bidirectional replication, we will execute the DDL at one side, for add or drop column the column number will mismatch. cluster A <-> cluster B drop column of table t at cluster A some DML of table t at cluster B will miss the column dropped compared to cluster A * binlog loop back sync (#879) In the AA dual activity scenario, there is data write (DML) on both sides. The data of tidb cluster on both sides needs to be synchronized with each other,but avoid loopback synchronization,and ddl is only writed one side. add three variables in drainer.toml as identification to confirm need sync ddl or not and need set sync mark identification or not and sync identification id to Avoid loopback synchronization add configuration item loopback-control (true/false) set mark table identification or not and filter txn by mark table ddl-sync (true/false) sync ddl to downstream DB or not channel-id (integer) sync identification id,avoid loopback synchronization Co-authored-by: Nihao123451 <37206498+Nihao123451@users.noreply.github.com> Co-authored-by: freemindLi <59459626+freemindLi@users.noreply.github.com> Co-authored-by: Nihao123451 <37206498+Nihao123451@users.noreply.github.com>
What problem does this PR solve?
allow when the column number of downstream table mismatch with current schema.
For the case bidirectional replication, we will execute the DDL at one side, for add or drop column
the column number will mismatch.
cluster A <-> cluster B
t
at cluster At
at cluster B will miss the column dropped compared to cluster AWhat is changed and how it works?
Add a config item
sync-mode
when setting SyncPartialColumn will allow mismatch column number
and relax sql mode by removing STRICT_TRANS_TABLES.
Check List
Tests
Code changes
Side effects
Related changes