From 198dee43b9385f592a5f82ede03a34721a84e112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Mon, 14 Mar 2022 11:49:41 +0100 Subject: [PATCH] Improve error message when no viable server is found due to GTID waiting --- lib/MySQL_HostGroups_Manager.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 5e6970ecc..58f1a641b 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -2901,9 +2901,13 @@ MySrvC *MyHGC::get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_ } if (t - last_hg_log > 1) { // log this at most once per second to avoid spamming the logs last_hg_log = time(NULL); - proxy_error("Hostgroup %u has no servers available%s! Checking servers shunned for more than %u second%s\n", hid, - (max_connections_reached ? " or max_connections reached for all servers" : ""), - max_wait_sec, max_wait_sec == 1 ? "" : "s"); + + if (gtid_trxid) { + proxy_error("Hostgroup %u has no servers ready for GTID '%s:%d'. Waiting for replication...\n", hid, gtid_uuid, gtid_trxid); + } else { + proxy_error("Hostgroup %u has no servers available%s! Checking servers shunned for more than %u second%s\n", hid, + (max_connections_reached ? " or max_connections reached for all servers" : ""), max_wait_sec, max_wait_sec == 1 ? "" : "s"); + } } for (j=0; jidx(j);