Skip to content

Commit fb130f1

Browse files
authored
v1.0.0 don't support binlog.drainer.config (#775)
1 parent aaf4e46 commit fb130f1

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

tests/actions.go

+34-17
Original file line numberDiff line numberDiff line change
@@ -2291,31 +2291,48 @@ func (oa *operatorActions) DeployIncrementalBackup(from *TidbClusterConfig, to *
22912291
oa.EmitEvent(from, fmt.Sprintf("DeployIncrementalBackup: slave: %s", to.ClusterName))
22922292
glog.Infof("begin to deploy incremental backup cluster[%s] namespace[%s]", from.ClusterName, from.Namespace)
22932293

2294-
sets := map[string]string{
2295-
"binlog.pump.create": "true",
2294+
// v1.0.0 don't support `binlog.drainer.config`
2295+
// https://github.com/pingcap/tidb-operator/pull/693
2296+
isv1 := from.OperatorTag == "v1.0.0"
2297+
2298+
var sets map[string]string
2299+
if isv1 {
2300+
sets = map[string]string{
2301+
"binlog.pump.create": "true",
2302+
"binlog.drainer.destDBType": "mysql",
2303+
"binlog.drainer.mysql.host": fmt.Sprintf("%s-tidb.%s", to.ClusterName, to.Namespace),
2304+
"binlog.drainer.mysql.user": "root",
2305+
"binlog.drainer.mysql.password": to.Password,
2306+
"binlog.drainer.mysql.port": "4000",
2307+
"binlog.drainer.ignoreSchemas": "",
2308+
}
2309+
} else {
2310+
sets = map[string]string{
2311+
"binlog.pump.create": "true",
2312+
}
2313+
from.drainerConfig = []string{
2314+
"worker-count = 16",
2315+
"detect-interval = 10",
2316+
"disable-dispatch = false",
2317+
`ignore-schemas = ""`,
2318+
`safe-mode = false`,
2319+
`txn-batch = 20`,
2320+
`db-type = "mysql"`,
2321+
`[syncer.to]`,
2322+
fmt.Sprintf(`host = "%s-tidb.%s"`, to.ClusterName, to.Namespace),
2323+
fmt.Sprintf(`user = "%s"`, "root"),
2324+
fmt.Sprintf(`password = "%s"`, to.Password),
2325+
fmt.Sprintf(`port = %d`, 4000),
2326+
}
22962327
}
2328+
22972329
if withDrainer {
22982330
sets["binlog.drainer.create"] = "true"
22992331
}
23002332
if ts != "" {
23012333
sets["binlog.drainer.initialCommitTs"] = ts
23022334
}
23032335

2304-
from.drainerConfig = []string{
2305-
"worker-count = 16",
2306-
"detect-interval = 10",
2307-
"disable-dispatch = false",
2308-
`ignore-schemas = ""`,
2309-
`safe-mode = false`,
2310-
`txn-batch = 20`,
2311-
`db-type = "mysql"`,
2312-
`[syncer.to]`,
2313-
fmt.Sprintf(`host = "%s-tidb.%s"`, to.ClusterName, to.Namespace),
2314-
fmt.Sprintf(`user = "%s"`, "root"),
2315-
fmt.Sprintf(`password = "%s"`, to.Password),
2316-
fmt.Sprintf(`port = %d`, 4000),
2317-
}
2318-
23192336
cmd, err := oa.getHelmUpgradeClusterCmd(from, sets)
23202337
if err != nil {
23212338
return err

0 commit comments

Comments
 (0)