Skip to content

Commit 04aaf83

Browse files
committed
Fixing MariaDB Multi source bootstrap replication error
1 parent 45a0adb commit 04aaf83

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

etc/opensvc/cluster-api/cluster-demo/stephane.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ prov-proxy-service-type = "docker"
3434
prov-proxy-disk-type = "volume"
3535
prov-proxy-volume-data = "tank"
3636
test=true
37-
arbitration-external= true
38-
arbitration-external-hosts="10.8.0.50:8080"
39-
arbitration-peer-hosts="10.8.0.72:10001"
40-
arbitration-external-secret="tnstest"
37+
#arbitration-external= true
38+
#arbitration-external-hosts="10.8.0.50:8080"
39+
#arbitration-peer-hosts="10.8.0.72:10001"
40+
#arbitration-external-secret="tnstest"

utils/dbhelper/dbhelper.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -587,14 +587,15 @@ func ChangeMaster(db *sqlx.DB, opt ChangeMasterOpt, myver *MySQLVersion) (string
587587
}
588588
cm += "CREATE SUBSCRIPTION " + opt.Channel + " CONNECTION 'dbname=" + opt.PostgressDB + " host=" + misc.Unbracket(opt.Host) + " user=" + opt.User + " port=" + opt.Port + " password=" + opt.Password + " ' PUBLICATION " + opt.Channel + " WITH (enabled=false, copy_data=false, create_slot=true)"
589589
} else {
590-
591-
cm += "CHANGE MASTER TO "
590+
if myver.IsMariaDB() && opt.Channel != "" {
591+
cm += "CHANGE " + masterOrSource + " '" + opt.Channel + "' TO "
592+
} else {
593+
cm += "CHANGE " + masterOrSource + " TO "
594+
}
592595
if myver.IsMySQLOrPercona() && ((myver.Major >= 8 && myver.Minor > 0) || (myver.Major >= 8 && myver.Minor == 0 && myver.Release >= 23)) {
593596
cm = "CHANGE REPLICATION SOURCE TO "
594597
}
595-
if myver.IsMariaDB() && opt.Channel != "" {
596-
cm += " '" + opt.Channel + "'"
597-
}
598+
598599
if opt.Mode == "GROUP_REPL" {
599600
cm += masterOrSource + "_user='" + opt.User + "', " + masterOrSource + "_password='" + opt.Password + "'"
600601
} else {

0 commit comments

Comments
 (0)