@@ -263,6 +263,9 @@ type TidbClusterConfig struct {
263
263
BlockWriteConfig blockwriter.Config
264
264
GrafanaClient * metrics.Client
265
265
TopologyKey string
266
+
267
+ pumpConfig []string
268
+ drainerConfig []string
266
269
}
267
270
268
271
func (tc * TidbClusterConfig ) String () string {
@@ -2289,13 +2292,7 @@ func (oa *operatorActions) DeployIncrementalBackup(from *TidbClusterConfig, to *
2289
2292
glog .Infof ("begin to deploy incremental backup cluster[%s] namespace[%s]" , from .ClusterName , from .Namespace )
2290
2293
2291
2294
sets := map [string ]string {
2292
- "binlog.pump.create" : "true" ,
2293
- "binlog.drainer.destDBType" : "mysql" ,
2294
- "binlog.drainer.mysql.host" : fmt .Sprintf ("%s-tidb.%s" , to .ClusterName , to .Namespace ),
2295
- "binlog.drainer.mysql.user" : "root" ,
2296
- "binlog.drainer.mysql.password" : to .Password ,
2297
- "binlog.drainer.mysql.port" : "4000" ,
2298
- "binlog.drainer.ignoreSchemas" : "" ,
2295
+ "binlog.pump.create" : "true" ,
2299
2296
}
2300
2297
if withDrainer {
2301
2298
sets ["binlog.drainer.create" ] = "true"
@@ -2304,14 +2301,29 @@ func (oa *operatorActions) DeployIncrementalBackup(from *TidbClusterConfig, to *
2304
2301
sets ["binlog.drainer.initialCommitTs" ] = ts
2305
2302
}
2306
2303
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
+
2307
2319
cmd , err := oa .getHelmUpgradeClusterCmd (from , sets )
2308
2320
if err != nil {
2309
2321
return err
2310
2322
}
2311
2323
glog .Infof (cmd )
2312
2324
res , err := exec .Command ("/bin/sh" , "-c" , cmd ).CombinedOutput ()
2313
2325
if err != nil {
2314
- return fmt .Errorf ("failed to launch scheduler backup job: %v, %s" , err , string (res ))
2326
+ return fmt .Errorf ("failed to launch incremental backup job: %v, %s" , err , string (res ))
2315
2327
}
2316
2328
return nil
2317
2329
}
@@ -2439,7 +2451,7 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD
2439
2451
2440
2452
err := wait .Poll (oa .pollInterval , DefaultPollTimeout , fn )
2441
2453
if err != nil {
2442
- return fmt .Errorf ("failed to launch scheduler backup job: %v" , err )
2454
+ return fmt .Errorf ("failed to check incremental backup job: %v" , err )
2443
2455
}
2444
2456
return nil
2445
2457
0 commit comments