Skip to content

Commit

Permalink
shard DDL: rewrite shard DDL in pessimism mode for HA (pingcap#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored Feb 11, 2020
1 parent 7135428 commit 2a8a594
Show file tree
Hide file tree
Showing 54 changed files with 2,657 additions and 3,954 deletions.
2 changes: 1 addition & 1 deletion cmd/dm-syncer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
log.L().Info("", zap.Stringer("dm-syncer conf", conf))
})

sync := syncer.NewSyncer(conf)
sync := syncer.NewSyncer(conf, nil) // do not support shard DDL for singleton syncer.
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)

Expand Down
7 changes: 7 additions & 0 deletions dm/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ var (
// UpstreamSubTaskKeyAdapter used to store SubTask which are subscribing data from MySQL source.
// k/v: Encode(source-id, task-name) -> SubTaskConfig
UpstreamSubTaskKeyAdapter KeyAdapter = keyHexEncoderDecoder("/dm-master/upstream/subtask/")

// ShardDDLPessimismInfoKeyAdapter used to store shard DDL info in pessimistic model.
// k/v: Encode(task-name, source-id) -> shard DDL info
ShardDDLPessimismInfoKeyAdapter KeyAdapter = keyHexEncoderDecoder("/dm-master/shardddl-pessimism/info/")
// ShardDDLPessimismOperationKeyAdapter used to store shard DDL lock in pessimistic model.
// k/v: Encode(task-name, source-id) -> shard DDL operation
ShardDDLPessimismOperationKeyAdapter KeyAdapter = keyHexEncoderDecoder("/dm-master/shardddl-pessimism/operation/")
)

func keyAdapterKeysLen(s KeyAdapter) int {
Expand Down
Loading

0 comments on commit 2a8a594

Please sign in to comment.