Affects Version/s: 1.4.14
Fix Version/s: 1.4.16
Acording to our online documentation at https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html scheduler should respect pxc_maint_transition_period to accommodate for long-running queries:
You can increase the transition period using the pxc_maint_transition_period variable to accomodate for long-running transactions. If the period is long enough for all transactions to finish, there should hardly be any disruption in cluster workload.
During the transition period, the node continues to receive existing write-set replication traffic, ProxySQL avoids openning new connections and starting transactions, but the user can still open conenctions to monitor status.
However, that is not the case.
In a PXC point of view, the workflow goes as below:
- Change the status to whatever was set as pxc_maint_mode
- Sleep for pxc_maint_transition_period
If you want to set your writer to MAINTENANCE below work-flow will happen:
- 1st run of the scheduler will:
- Identify the server is on MAINTENANCE mode and change it's status to OFFLINE_SOFT - This node will handle the currently open connection. No new connection will be redirected to it
- Promote a new node to become the new writer - This node will handle all new connections
- 2nd run of the scheduler will (HERE IS THE BUG)
- Remove old writer that is with status OFFLINE_SOFT, this will cause all current connections to be closed
If for example, you have your scheduler configured to run every 1000ms and has pxc_maint_transition_period configure to 20 seconds, your stablished connections with MAINTANANCE master will be closed after 2 seconds (2 runs of the scheduler) and not after 20 seconds.