@@ -2291,31 +2291,48 @@ func (oa *operatorActions) DeployIncrementalBackup(from *TidbClusterConfig, to *
2291
2291
oa .EmitEvent (from , fmt .Sprintf ("DeployIncrementalBackup: slave: %s" , to .ClusterName ))
2292
2292
glog .Infof ("begin to deploy incremental backup cluster[%s] namespace[%s]" , from .ClusterName , from .Namespace )
2293
2293
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
+ }
2296
2327
}
2328
+
2297
2329
if withDrainer {
2298
2330
sets ["binlog.drainer.create" ] = "true"
2299
2331
}
2300
2332
if ts != "" {
2301
2333
sets ["binlog.drainer.initialCommitTs" ] = ts
2302
2334
}
2303
2335
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
-
2319
2336
cmd , err := oa .getHelmUpgradeClusterCmd (from , sets )
2320
2337
if err != nil {
2321
2338
return err
0 commit comments