Skip to content

Commit

Permalink
Lagging replicas should not affert WaitSlaveCount (#136)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksandr Shevchuk <[email protected]>
  • Loading branch information
teem0n and Aleksandr Shevchuk authored Oct 3, 2024
1 parent 63cd7e3 commit 4a012aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,9 @@ func (app *App) updateActiveNodes(clusterState, clusterStateDcs map[string]*Node
if masterState.SemiSyncState != nil && masterState.SemiSyncState.MasterEnabled {
oldWaitSlaveCount = masterState.SemiSyncState.WaitSlaveCount
}
waitSlaveCount := app.switchHelper.GetRequiredWaitSlaveCount(activeNodes)
// data lagging replicas should not affect WaitSlaveCount
notLaggingActive := filterOut(activeNodes, becomeDataLag)
waitSlaveCount := app.switchHelper.GetRequiredWaitSlaveCount(notLaggingActive)

app.logger.Infof("update active nodes: active nodes are: %v, wait_slave_count %d", activeNodes, waitSlaveCount)
if len(becomeActive) > 0 {
Expand Down

0 comments on commit 4a012aa

Please sign in to comment.