File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ import (
15
15
_ "github.com/mattn/go-sqlite3"
16
16
17
17
log "github.com/Sirupsen/logrus"
18
- "github.com/spf13/cobra"
19
18
"github.com/signal18/replication-manager/cluster"
20
19
"github.com/signal18/replication-manager/dbhelper"
20
+ "github.com/spf13/cobra"
21
21
)
22
22
23
23
type route struct {
@@ -294,6 +294,10 @@ func fHeartbeat() {
294
294
currentCluster .LogPrintf ("DEBUG" , "Peer node is Active, I am Standby" )
295
295
runStatus = "S"
296
296
}
297
+ // propagate all runStatus to clusters after peer negotiation
298
+ for _ , cl := range clusters {
299
+ cl .SetActiveStatus (runStatus )
300
+ }
297
301
}
298
302
299
303
}
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ func (server *ServerMonitor) check(wg *sync.WaitGroup) {
290
290
}
291
291
server .State = stateUnconn
292
292
server .FailCount = 0
293
- if server .ClusterGroup .conf .Autorejoin {
293
+ if server .ClusterGroup .conf .Autorejoin && server . ClusterGroup . IsActive () {
294
294
server .RejoinMaster ()
295
295
} else {
296
296
server .ClusterGroup .LogPrintf ("INFO" , "Auto Rejoin is disabled" )
@@ -307,7 +307,7 @@ func (server *ServerMonitor) check(wg *sync.WaitGroup) {
307
307
server .PrevState = server .State
308
308
}
309
309
return
310
- } else if errss == nil && (server .PrevState == stateFailed || server .PrevState == stateSuspect ) {
310
+ } else if server . ClusterGroup . IsActive () && errss == nil && (server .PrevState == stateFailed || server .PrevState == stateSuspect ) {
311
311
server .rejoinSlave (ss )
312
312
}
313
313
You can’t perform that action at this time.
0 commit comments