From a9e7af8a7bc6df32a0c5dd53db527935202cf9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Tue, 12 Mar 2024 11:14:54 +0100 Subject: [PATCH] Add 'session_id' to server lost during query error msg If multiple backend connections are lost at the same time, the same message will appear multiple times, one per backend connection that was lost during a query, this info wasn't reflected in the msg before. --- lib/MySQL_Session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index ac9d00fc7a..91e2207c4e 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -4370,11 +4370,11 @@ int MySQL_Session::handler_ProcessingQueryError_CheckBackendConnectionStatus(MyS bool retry_conn=false; if (myconn->server_status==MYSQL_SERVER_STATUS_SHUNNED_REPLICATION_LAG) { thread->status_variables.stvar[st_var_backend_lagging_during_query]++; - proxy_error("Detected a lagging server during query: %s, %d\n", myconn->parent->address, myconn->parent->port); + proxy_error("Detected a lagging server during query: %s, %d, session_id:%u\n", myconn->parent->address, myconn->parent->port, this->thread_session_id); MyHGM->p_update_mysql_error_counter(p_mysql_error_type::proxysql, myconn->parent->myhgc->hid, myconn->parent->address, myconn->parent->port, ER_PROXYSQL_LAGGING_SRV); } else { thread->status_variables.stvar[st_var_backend_offline_during_query]++; - proxy_error("Detected an offline server during query: %s, %d\n", myconn->parent->address, myconn->parent->port); + proxy_error("Detected an offline server during query: %s, %d, session_id:%u\n", myconn->parent->address, myconn->parent->port, this->thread_session_id); MyHGM->p_update_mysql_error_counter(p_mysql_error_type::proxysql, myconn->parent->myhgc->hid, myconn->parent->address, myconn->parent->port, ER_PROXYSQL_OFFLINE_SRV); } if (myds->query_retries_on_failure > 0) {