Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix v1.0.0 don't support binlog.drainer.config #775

Merged
merged 2 commits into from
Aug 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions tests/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2291,31 +2291,48 @@ func (oa *operatorActions) DeployIncrementalBackup(from *TidbClusterConfig, to *
oa.EmitEvent(from, fmt.Sprintf("DeployIncrementalBackup: slave: %s", to.ClusterName))
glog.Infof("begin to deploy incremental backup cluster[%s] namespace[%s]", from.ClusterName, from.Namespace)

sets := map[string]string{
"binlog.pump.create": "true",
// v1.0.0 don't support `binlog.drainer.config`
// https://github.com/pingcap/tidb-operator/pull/693
isv1 := from.OperatorTag == "v1.0.0"

var sets map[string]string
if isv1 {
sets = map[string]string{
"binlog.pump.create": "true",
"binlog.drainer.destDBType": "mysql",
"binlog.drainer.mysql.host": fmt.Sprintf("%s-tidb.%s", to.ClusterName, to.Namespace),
"binlog.drainer.mysql.user": "root",
"binlog.drainer.mysql.password": to.Password,
"binlog.drainer.mysql.port": "4000",
"binlog.drainer.ignoreSchemas": "",
}
} else {
sets = map[string]string{
"binlog.pump.create": "true",
}
from.drainerConfig = []string{
"worker-count = 16",
"detect-interval = 10",
"disable-dispatch = false",
`ignore-schemas = ""`,
`safe-mode = false`,
`txn-batch = 20`,
`db-type = "mysql"`,
`[syncer.to]`,
fmt.Sprintf(`host = "%s-tidb.%s"`, to.ClusterName, to.Namespace),
fmt.Sprintf(`user = "%s"`, "root"),
fmt.Sprintf(`password = "%s"`, to.Password),
fmt.Sprintf(`port = %d`, 4000),
}
}

if withDrainer {
sets["binlog.drainer.create"] = "true"
}
if ts != "" {
sets["binlog.drainer.initialCommitTs"] = ts
}

from.drainerConfig = []string{
"worker-count = 16",
"detect-interval = 10",
"disable-dispatch = false",
`ignore-schemas = ""`,
`safe-mode = false`,
`txn-batch = 20`,
`db-type = "mysql"`,
`[syncer.to]`,
fmt.Sprintf(`host = "%s-tidb.%s"`, to.ClusterName, to.Namespace),
fmt.Sprintf(`user = "%s"`, "root"),
fmt.Sprintf(`password = "%s"`, to.Password),
fmt.Sprintf(`port = %d`, 4000),
}

cmd, err := oa.getHelmUpgradeClusterCmd(from, sets)
if err != nil {
return err
Expand Down