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.
v3.0-ci260323
Rene Cannao 2 weeks ago
parent f98a0e85ed
commit b02147b92b

@ -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}');"

Loading…
Cancel
Save