-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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>
- Loading branch information
1 parent
e9cce0d
commit a50a36f
Showing
15 changed files
with
451 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2019 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package loopbacksync | ||
|
||
const ( | ||
//MarkTableName mark table name | ||
MarkTableName = "retl._drainer_repl_mark" | ||
//ChannelID channel id | ||
ChannelID = "channel_id" | ||
//Val val | ||
Val = "val" | ||
//ChannelInfo channel info | ||
ChannelInfo = "channel_info" | ||
) | ||
|
||
//LoopBackSync loopback sync info | ||
type LoopBackSync struct { | ||
ChannelID int64 | ||
LoopbackControl bool | ||
SyncDDL bool | ||
} | ||
|
||
//NewLoopBackSyncInfo return LoopBackSyncInfo objec | ||
func NewLoopBackSyncInfo(ChannelID int64, LoopbackControl, SyncDDL bool) *LoopBackSync { | ||
l := &LoopBackSync{ | ||
ChannelID: ChannelID, | ||
LoopbackControl: LoopbackControl, | ||
SyncDDL: SyncDDL, | ||
} | ||
return l | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2019 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package loopbacksync | ||
|
||
import "testing" | ||
|
||
//TestNewLoopBackSyncInfo test loopBackSyncInfo alloc | ||
func TestNewLoopBackSyncInfo(t *testing.T) { | ||
var ChannelID int64 = 1 | ||
var LoopbackControl = true | ||
var SyncDDL = false | ||
l := NewLoopBackSyncInfo(ChannelID, LoopbackControl, SyncDDL) | ||
if l == nil { | ||
t.Error("alloc loopBackSyncInfo objec failed ") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.