DB Host getting re-added to mysql_servers table after delete : A Bug ?

16 views
Skip to first unread message

Mahendra Singh Bisht

unread,
Aug 5, 2026, 2:01:55 PMAug 5
to proxysql
Hi team,

We are using ProxySQL of version 2.4.7-5-gd467cc0, codename Truls and MySQL Server version : Percona Server for MySQL 5.7.40-43-log.

We were having issues with the Master DB getting overloaded with connections resulting into max_connections issue so here is what we did : On the ProxySQL side, we had configured Master DB with the reader hostgroup_id : 20 and 30 along with write hostgroup_id 10. Since we have enough replicas to support read so we removed the Master DB from the reader hostgroup to avoid the master running into max_connections again.

ProxySQLAdmin> select * from mysql_servers;
+--------------+--------------------------+------+-----------+--------------+--------+-------------+-----------------+---------------------+---------+----------------+-----------------------------+
| hostgroup_id | hostname                 | port | gtid_port | status       | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment                     |
+--------------+--------------------------+------+-----------+--------------+--------+-------------+-----------------+---------------------+---------+----------------+-----------------------------+
| 10           | va-db-main-002           | 3306 | 0         | OFFLINE_SOFT | 1      | 0           | 2000            | 300                 | 0       | 0              | Master                      |
| 10           | replica-009        | 3306 | 0         | OFFLINE_SOFT | 1      | 0           | 2000            | 300                 | 0       | 0              | Master                      |
| 12           | va-db-main-social-002    | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2000            | 0                   | 0       | 0              | Master-Social               |
| 10           | main-db           | 3306 | 0         | ONLINE       | 100    | 0           | 2500            | 300                 | 0       | 0              |                             |
| 20           | va-db-main-004           | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2500            | 300                 | 0       | 0              |                             |
| 20           | replica-001        | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-003        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-004        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-006        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-007        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-008        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 11           | main-db           | 3306 | 0         | ONLINE       | 100    | 0           | 250             | 300                 | 0       | 0              | BD Writer              |
| 30           | replica-005        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              | BD Replicas            |
| 30           | replica-014        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              | BD Replicas            |
| 40           | replica-social-001 | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2000            | 0                   | 0       | 0              | Replica-Social              |
| 50           | va-invdb02               | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2500            | 300                 | 0       | 0              | IDB Master          |
| 60           | va-invdb01               | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 1000            | 300                 | 0       | 0              | IDB Replica         |
| 70           | va-invdb-bd01            | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 1000            | 300                 | 0       | 0              | IDB BD Replica |
| 80           | replica-012        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              | Dedicated BD replica   |
| 20           | main-db           | 3306 | 0         | ONLINE       | 100    | 0           | 2500            | 300                 | 0       | 0              |                             |
| 30           | main-db           | 3306 | 0         | ONLINE       | 100    | 0           | 250             | 300                 | 0       | 0              | BD Writer              |
+--------------+--------------------------+------+-----------+--------------+--------+-------------+-----------------+---------------------+---------+----------------+-----------------------------+
21 rows in set (0.00 sec)

ProxySQLAdmin> DELETE FROM mysql_servers
WHERE hostname = 'main-db'
  AND port = 3306
  AND hostgroup_id IN (20, 30);
Query OK, 2 rows affected (0.00 sec)

ProxySQLAdmin> LOAD MYSQL SERVERS TO RUNTIME;
SAVE MYSQL SERVERS TO DISK;
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

ProxySQLAdmin> select * from mysql_servers;
+--------------+--------------------------+------+-----------+--------------+--------+-------------+-----------------+---------------------+---------+----------------+-----------------------------+
| hostgroup_id | hostname                 | port | gtid_port | status       | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment                     |
+--------------+--------------------------+------+-----------+--------------+--------+-------------+-----------------+---------------------+---------+----------------+-----------------------------+
| 10           | va-db-main-002           | 3306 | 0         | OFFLINE_SOFT | 1      | 0           | 2000            | 300                 | 0       | 0              | Master                      |
| 10           | replica-009        | 3306 | 0         | OFFLINE_SOFT | 1      | 0           | 2000            | 300                 | 0       | 0              | Master                      |
| 12           | va-db-main-social-002    | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2000            | 0                   | 0       | 0              | Master-Social               |
| 10           | main-db           | 3306 | 0         | ONLINE       | 100    | 0           | 2500            | 300                 | 0       | 0              |                             |
| 20           | va-db-main-004           | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2500            | 300                 | 0       | 0              |                             |
| 20           | replica-001        | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-003        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-004        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-006        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-007        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 20           | replica-008        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              |                             |
| 11           | main-db           | 3306 | 0         | ONLINE       | 100    | 0           | 250             | 300                 | 0       | 0              | BD Writer              |
| 30           | replica-005        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              | BD Replicas            |
| 30           | replica-014        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              | BD Replicas            |
| 40           | replica-social-001 | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2000            | 0                   | 0       | 0              | Replica-Social              |
| 50           | va-invdb02               | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 2500            | 300                 | 0       | 0              | IDB Master          |
| 60           | va-invdb01               | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 1000            | 300                 | 0       | 0              | IDB Replica         |
| 70           | va-invdb-bd01            | 3306 | 0         | OFFLINE_SOFT | 100    | 0           | 1000            | 300                 | 0       | 0              | IDB BD Replica |
| 80           | replica-012        | 3306 | 0         | ONLINE       | 100    | 0           | 1000            | 300                 | 0       | 0              | Dedicated BD replica   |
+--------------+--------------------------+------+-----------+--------------+--------+-------------+-----------------+---------------------+---------+----------------+-----------------------------+
19 rows in set (0.00 sec)

ProxySQLAdmin>

I checked the mysql_servers table yesterday and noticed that the main-db was again found in hostgroup_id 20 and 30. This is not the expected behavior so I wanted to know did anyone faced similar issue or know if this a bug in this ProxySQL version?

How do I fix this critical issue?

Regards,
MS

René Cannaò

unread,
Aug 5, 2026, 2:39:06 PMAug 5
to Mahendra Singh Bisht, proxysql
Hi MS,

​ProxySQL operates strictly according to its configuration: it does not spontaneously re-add servers unless instructed to by a rule (such as mysql_replication_hostgroups), ProxySQL Cluster synchronization, or external automation scripts.

​Please review your replication hostgroup mappings and local ProxySQL logs to identify which configured mechanism is re-adding the server in your environment.
Very important: check logs before jumping to any "is this a bug?" conclusion.

​If this is a critical production issue and you require direct hands-on troubleshooting or dedicated assistance, please reach out through our official commercial support channels.

​Regards,
René

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/proxysql/d215b5d5-35c4-48bc-a244-5b78bd0f75e3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages