Skip to content

Commit

Permalink
Fixing MariaDB Multi source bootstrap replication error
Browse files Browse the repository at this point in the history
  • Loading branch information
svaroqui committed Feb 27, 2023
1 parent 45a0adb commit 04aaf83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions etc/opensvc/cluster-api/cluster-demo/stephane.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ prov-proxy-service-type = "docker"
prov-proxy-disk-type = "volume"
prov-proxy-volume-data = "tank"
test=true
arbitration-external= true
arbitration-external-hosts="10.8.0.50:8080"
arbitration-peer-hosts="10.8.0.72:10001"
arbitration-external-secret="tnstest"
#arbitration-external= true
#arbitration-external-hosts="10.8.0.50:8080"
#arbitration-peer-hosts="10.8.0.72:10001"
#arbitration-external-secret="tnstest"
11 changes: 6 additions & 5 deletions utils/dbhelper/dbhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,15 @@ func ChangeMaster(db *sqlx.DB, opt ChangeMasterOpt, myver *MySQLVersion) (string
}
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)"
} else {

cm += "CHANGE MASTER TO "
if myver.IsMariaDB() && opt.Channel != "" {
cm += "CHANGE " + masterOrSource + " '" + opt.Channel + "' TO "
} else {
cm += "CHANGE " + masterOrSource + " TO "
}
if myver.IsMySQLOrPercona() && ((myver.Major >= 8 && myver.Minor > 0) || (myver.Major >= 8 && myver.Minor == 0 && myver.Release >= 23)) {
cm = "CHANGE REPLICATION SOURCE TO "
}
if myver.IsMariaDB() && opt.Channel != "" {
cm += " '" + opt.Channel + "'"
}

if opt.Mode == "GROUP_REPL" {
cm += masterOrSource + "_user='" + opt.User + "', " + masterOrSource + "_password='" + opt.Password + "'"
} else {
Expand Down

0 comments on commit 04aaf83

Please sign in to comment.