From b02147b92b89d4a90446e6be56634ec0b0c6de45 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Tue, 24 Mar 2026 08:55:35 +0000 Subject: [PATCH] Include primary in its own proxysql_servers table When a cluster node syncs proxysql_servers from the primary and runs LOAD PROXYSQL SERVERS TO RUNTIME, it rebuilds the node list from the synced data. If the primary isn't in its own proxysql_servers table, the synced list won't include it. The node then destroys the cluster monitor thread for the primary and never recreates it. Evidence: node 1 log shows "Destroyed Cluster Node Entry for host proxysql:6032" followed by "closing thread for peer proxysql:6032" after syncing proxysql_servers from the primary. After that, the node never detected any further checksum changes from the primary, causing test_cluster1-t and test_unshun_algorithm-t to fail. Fixes #5542. --- test/infra/control/start-proxysql-isolated.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/infra/control/start-proxysql-isolated.bash b/test/infra/control/start-proxysql-isolated.bash index d6e29a09c..310e5703d 100755 --- a/test/infra/control/start-proxysql-isolated.bash +++ b/test/infra/control/start-proxysql-isolated.bash @@ -174,6 +174,10 @@ if [ "${NUM_NODES}" -gt 0 ]; then CORE_NODES=3 if [ "${NUM_NODES}" -lt 3 ]; then CORE_NODES="${NUM_NODES}"; fi PROXYSQL_SERVERS_SQL="DELETE FROM proxysql_servers;" + # Include the primary itself — if a node syncs proxysql_servers from the primary, + # the primary must be in the list, otherwise the node drops its monitor thread + # for the primary and never detects checksum changes again. + PROXYSQL_SERVERS_SQL="${PROXYSQL_SERVERS_SQL} INSERT INTO proxysql_servers (hostname,port,weight,comment) VALUES ('proxysql',6032,0,'primary');" for i in $(seq 1 "${CORE_NODES}"); do PORT=$((6032 + i * 10)) PROXYSQL_SERVERS_SQL="${PROXYSQL_SERVERS_SQL} INSERT INTO proxysql_servers (hostname,port,weight,comment) VALUES ('proxysql',${PORT},0,'core-node${i}');"