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

@ -1649,3 +1649,10 @@ uint32_t mxs_mysql_extract_ps_id(GWBUF* buffer)
return rval;
}
bool mxs_mysql_command_will_respond(uint8_t cmd)
{
return cmd != MYSQL_COM_STMT_SEND_LONG_DATA &&
cmd != MYSQL_COM_QUIT &&
cmd != MYSQL_COM_STMT_CLOSE;
}