From 90670b45725d043e2b70eaeed73d20c913e1fe3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 11 Jan 2023 22:22:04 +0000 Subject: [PATCH] Do not shun servers with max_replication_lag = 0 #4018 If max_replication_lag is 0 and mysql-monitor_replication_lag_group_by_host='true', a replica was incorrectly shunned because of replication lag --- lib/MySQL_HostGroups_Manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index b32fa8852..c517553aa 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -3554,7 +3554,11 @@ void MySQL_HostGroups_Manager::replication_lag_action_inner(MyHGC *myhgc, char * if ( // (current_replication_lag==-1 ) // || - (current_replication_lag>=0 && ((unsigned int)current_replication_lag > mysrvc->max_replication_lag)) + ( + current_replication_lag>=0 && + mysrvc->max_replication_lag > 0 && // see issue #4018 + ((unsigned int)current_replication_lag > mysrvc->max_replication_lag) + ) ) { // always increase the counter mysrvc->cur_replication_lag_count += 1;