Skip to content

Commit

Permalink
Switchover failure need current_pos as slave_pos is not updated on ma…
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
svaroqui committed Mar 12, 2018
1 parent 630d2b5 commit 55e13bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cluster/failover.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,15 @@ func (cluster *Cluster) MasterFailover(fail bool) bool {
}
} else if cluster.conf.MxsBinlogOn == false {
cluster.LogPrintf(LvlInfo, "Doing MariaDB GTID switch of the old master")
// current pos is needed on old master as writes diverges from slave pos
changeMasterErr = dbhelper.ChangeMaster(oldMaster.Conn, dbhelper.ChangeMasterOpt{
Host: cluster.master.Host,
Port: cluster.master.Port,
User: cluster.rplUser,
Password: cluster.rplPass,
Retry: strconv.Itoa(cluster.conf.ForceSlaveHeartbeatRetry),
Heartbeat: strconv.Itoa(cluster.conf.ForceSlaveHeartbeatTime),
Mode: "SLAVE_POS",
Mode: "CURRENT_POS",
SSL: cluster.conf.ReplicationSSL,
})
if changeMasterErr != nil {
Expand Down

0 comments on commit 55e13bc

Please sign in to comment.