Skip to content

Commit 82696ce

Browse files
author
Guillaume Lefranc
committed
Fix master checks happening on failover
1 parent aeb2e97 commit 82696ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monitor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (server *ServerMonitor) electCandidate(l []*ServerMonitor) int {
218218
hiseq := 0
219219
var max uint64
220220
for i, sl := range l {
221-
if server.State != stateFailed {
221+
if server.State != stateFailed && server.PrevState != stateMaster {
222222
if verbose {
223223
logprintf("DEBUG: Checking eligibility of slave server %s [%d]", sl.URL, i)
224224
}

0 commit comments

Comments
 (0)