MXS-852: Handle one-way session commands

Session commands that will not return a response can be completed
immediately. This requires some special code in the readwritesplit Backend
class implementation as well as a small addition to the Backend class
itself.

Since not all commands expect a response from the server, the queued query
routing function needs some adjustment. The routing of queued queries
should be attempted until a command which expects a response is found or
the queue is empty.

By properly handling these types of session commands, the router can
enable the execution of COM_STMT_CLOSE and COM_STMT_RESET on all
servers. This will prevent resource leakages in the server and allow
proper handling of COM_STMT type command.
This commit is contained in:
Markus Mäkelä
2017-06-22 13:16:12 +03:00
parent 5fc30740b7
commit 52b7fb9340
8 changed files with 46 additions and 28 deletions

View File

@ -547,4 +547,13 @@ bool mxs_mysql_extract_ps_response(GWBUF* buffer, MXS_PS_RESPONSE* out);
*/
uint32_t mxs_mysql_extract_ps_id(GWBUF* buffer);
/**
* @brief Determine if a packet contains a one way message
*
* @param cmd Command to inspect
*
* @return True if a response is expected from the server
*/
bool mxs_mysql_command_will_respond(uint8_t cmd);
MXS_END_DECLS