Skip to content
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

binlog loop back sync #884

Merged
merged 2 commits into from
Jan 15, 2020
Merged

binlog loop back sync #884

merged 2 commits into from
Jan 15, 2020

Conversation

july2993
Copy link
Contributor

What problem does this PR solve?

cherry pick #879 #867

What is changed and how it works?

cherry pick #879 #867

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

Check List

Code changes

july2993 and others added 2 commits January 15, 2020 10:34
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
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>
@july2993
Copy link
Contributor Author

/run-all-tests

@july2993 july2993 requested a review from suzaku January 15, 2020 02:51
@july2993
Copy link
Contributor Author

@suzaku @freemindLi PTAL

@july2993
Copy link
Contributor Author

/run-all-tests

@freemindLi
Copy link
Contributor

LGTM

Copy link
Contributor

@suzaku suzaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@july2993 july2993 merged commit a50a36f into pingcap:release-3.0 Jan 15, 2020
@july2993 july2993 deleted the pick_bsync branch January 15, 2020 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants