Skip to content

Commit 896681b

Browse files
committed
Flashback failed as always looking for all slave status and wrongly looking at the new master id
Default binlog format to row in configuration to enable flashback
1 parent cbadf7d commit 896681b

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

cluster/srv_rejoin.go

+16-11
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,14 @@ func (server *ServerMonitor) rejoinMasterIncremental(crash *Crash) error {
353353
} else {
354354
// don't try flashback on old style replication that are ahead jump to SST
355355
if server.HasGTIDReplication() == false {
356-
return errors.New("Incremental failed")
356+
server.ClusterGroup.LogPrintf("INFO", "Incremental canceled caused by old style replication")
357+
return errors.New("Incremental canceled caused by old style replication")
357358
}
358359
}
359360
if crash.FailoverIOGtid != nil {
360361
// server.ClusterGroup.master.FailoverIOGtid.GetSeqServerIdNos(uint64(server.ServerID)) == 0
361362
// lookup in crash recorded is the current master
362-
if crash.FailoverIOGtid.GetSeqServerIdNos(uint64(server.ClusterGroup.master.ServerID)) == 0 {
363+
if crash.FailoverIOGtid.GetSeqServerIdNos(uint64(server.ServerID)) == 0 {
363364
server.ClusterGroup.LogPrintf("INFO", "Cascading failover, consider we cannot flashback")
364365
server.ClusterGroup.canFlashBack = false
365366
} else {
@@ -654,21 +655,25 @@ func (cluster *Cluster) RejoinFixRelay(slave *ServerMonitor, relay *ServerMonito
654655

655656
// UseGtid check is replication use gtid
656657
func (server *ServerMonitor) UsedGtidAtElection(crash *Crash) bool {
657-
ss, errss := server.GetSlaveStatus(server.ReplicationSourceName)
658-
if errss != nil {
659-
return false
660-
}
661-
662-
server.ClusterGroup.LogPrintf(LvlDbg, "Rejoin Server use GTID %s", ss.UsingGtid.String)
658+
/*
659+
ss, errss := server.GetSlaveStatus(server.ReplicationSourceName)
660+
if errss != nil {
661+
server.ClusterGroup.LogPrintf(LvlInfo, "Failed to check if server was using GTID %s", errss)
662+
return false
663+
}
663664
665+
server.ClusterGroup.LogPrintf(LvlInfo, "Rejoin server using GTID %s", ss.UsingGtid.String)
666+
*/
664667
// An old master master do no have replication
665668
if crash.FailoverIOGtid == nil {
666-
server.ClusterGroup.LogPrintf(LvlDbg, "Rejoin server cannot find a saved master election GTID")
669+
server.ClusterGroup.LogPrintf(LvlInfo, "Rejoin server cannot find a saved master election GTID")
667670
return false
668671
}
669672
if len(crash.FailoverIOGtid.GetSeqNos()) > 0 {
673+
server.ClusterGroup.LogPrintf(LvlInfo, "Rejoin server found a crash GTID greater than 0 ")
670674
return true
671-
} else {
672-
return false
673675
}
676+
server.ClusterGroup.LogPrintf(LvlInfo, "Rejoin server can not found a GTID greater than 0 ")
677+
return false
678+
674679
}

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ func init() {
518518
monitorCmd.Flags().StringVar(&conf.ProvIopsLatency, "prov-db-disk-iops-latency", "0.002", "IO latency in s")
519519
monitorCmd.Flags().StringVar(&conf.ProvCores, "prov-db-cpu-cores", "1", "Number of cpu cores for the micro service VM")
520520
monitorCmd.Flags().BoolVar(&conf.ProvDBApplyDynamicConfig, "prov-db-apply-dynamic-config", false, "Dynamic database config change")
521-
monitorCmd.Flags().StringVar(&conf.ProvTags, "prov-db-tags", "semisync,innodb,noquerycache,threadpool,slow,pfs,docker,linux,readonly,diskmonitor,sqlerror,compressbinlog", "playbook configuration tags")
521+
monitorCmd.Flags().StringVar(&conf.ProvTags, "prov-db-tags", "semisync,row,innodb,noquerycache,threadpool,slow,pfs,docker,linux,readonly,diskmonitor,sqlerror,compressbinlog", "playbook configuration tags")
522522
monitorCmd.Flags().StringVar(&conf.ProvDomain, "prov-db-domain", "0", "Config domain id for the cluster")
523523
monitorCmd.Flags().StringVar(&conf.ProvMem, "prov-db-memory", "256", "Memory in M for micro service VM")
524524
monitorCmd.Flags().StringVar(&conf.ProvMemSharedPct, "prov-db-memory-shared-pct", "threads:16,innodb:60,myisam:10,aria:10,rocksdb:1,tokudb:1,s3:1,archive:1,querycache:0", "% memory shared per buffer")

0 commit comments

Comments
 (0)