From 82696ce53c618e718bc42bd374c287a2da6c00a3 Mon Sep 17 00:00:00 2001 From: Guillaume Lefranc Date: Tue, 10 May 2016 21:32:42 +0200 Subject: [PATCH] Fix master checks happening on failover --- monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.go b/monitor.go index 8389c23a7..db407bc53 100644 --- a/monitor.go +++ b/monitor.go @@ -218,7 +218,7 @@ func (server *ServerMonitor) electCandidate(l []*ServerMonitor) int { hiseq := 0 var max uint64 for i, sl := range l { - if server.State != stateFailed { + if server.State != stateFailed && server.PrevState != stateMaster { if verbose { logprintf("DEBUG: Checking eligibility of slave server %s [%d]", sl.URL, i) }