in Greating packet, maxscale does give a connection Id that isn't a real connection ID, but a fake connection id.
problem is this connection id is used in connectors.
In java connector (MariaDB and MySQL) it's used for mostly 2 things : Statement.cancel(), and Statement.setQueryTimeout()
When a query must be canceled or if timeout is reached, driver will create a new connection, and execute a "KILL QUERY XXX" (XXX the fake connection id).
This doesn't work when using maxscale :
- server will throw a "Unknown thread id: XXX"
- or if on server there is a connection that has the bad luck of having a corresponding connection id, it will killed .
Maxscale,as a proxy, must intercept query like "KILL [HARD | SOFT] [CONNECTION | QUERY ] thread_id"
and execute the kill command on the good server with real thread id.