diff --git a/cluster/cluster.go b/cluster/cluster.go index dc397bcab..825b7f951 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -694,6 +694,7 @@ func (cluster *Cluster) Run() { } cluster.IsFailable = cluster.GetStatus() + cluster.IsMasterDown = cluster.GetMaster() == nil || cluster.GetMaster().IsFailed() // CheckFailed trigger failover code if passing all false positiv and constraints cluster.CheckFailed() diff --git a/cluster/cluster_topo.go b/cluster/cluster_topo.go index e1f5e2ca6..b3b7c408a 100644 --- a/cluster/cluster_topo.go +++ b/cluster/cluster_topo.go @@ -516,7 +516,6 @@ func (cluster *Cluster) AllServersFailed() bool { func (cluster *Cluster) TopologyClusterDown() bool { // search for all cluster down if cluster.GetMaster() == nil || cluster.GetMaster().State == stateFailed { - cluster.IsMasterDown = true allslavefailed := true for _, s := range cluster.slaves { if s.State != stateFailed && s.State != stateErrorAuth && !s.IsIgnored() { @@ -544,7 +543,6 @@ func (cluster *Cluster) TopologyClusterDown() bool { } cluster.IsDown = false - cluster.IsMasterDown = false return false }