From 7b88df56650ab817777543980e5ffc8fbdf51f3d Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Tue, 1 Oct 2024 17:43:59 +0300 Subject: [PATCH] Lagging replicas should not affert WaitSlaveCount --- internal/app/app.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/app/app.go b/internal/app/app.go index 1bfb733..50f421b 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -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 {