OFFLINE_HARD won't drop connections immediately

111 views
Skip to first unread message

Yuehhsun Ho

unread,
Feb 29, 2024, 1:03:08 AM2/29/24
to proxysql
From the document: "when a server is put into OFFLINE_HARD mode, no new connections are created toward that server and the existing connections are immediately dropped." 

so it seems like the ConnUsed will be zero immediately?

but when I do the following steps:

0. There are two DBs, A and B. and there's an application connects to A
1. Add two DBs to proxysql's mysql_servers tables and made sure all settings were correct (monitoring worked, listening port was correct), A is status=ONLINE, B is status=OFFLINE_HARD.
2. Enable binlog replication from A to B.
3. Set the A's status to 'OFFLINE_HARD', and B's to 'ONLINE'


After the step 3, I sent request to the application, but found the following error:
it lasted for ~25 secs.

2024-02-29 05:48:31 MySQL_Session.cpp:4229:handler_ProcessingQueryError_CheckBackendConnectionStatus(): [ERROR] Detected an offline server during query: db.a.url, 3306
17
2024-02-29 05:48:34 MySQL_Session.cpp:3174:handler_again___status_CHANGING_AUTOCOMMIT(): [ERROR] Detected a broken connection while during SET AUTOCOMMIT on (1,db.a.url,3306,1930055) , user db_a_user , last_used 154077825ms ago : 9004, Detected offline server prior to statement execution

Is it normal to have this waiting time for all the connections to drop?
Thank you for your help!


René Cannaò

unread,
Feb 29, 2024, 1:39:38 AM2/29/24
to Yuehhsun Ho, proxysql
Hi Yuehhsun,

In the error log you should have seen a warning like the following:

Removed server at address %lld, hostgroup %s, address %s port %s. Setting status OFFLINE HARD and immediately dropping all free connections. Used connections will be dropped when trying to use them


This should answer your question.

Although I don't think the documentation is incorrect, I will now update it to make it more specific.


Thanks,

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 on the web visit https://groups.google.com/d/msgid/proxysql/b52f1a43-106c-4503-8b0b-302170446772n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages