MXS-2144: Treat server shutdown as a network error

If the server where a query is being executed is shutting down,
readwritesplit should treat it as an error to make retrying of the query
possible.

By treating server shutdowns as network errors, the same code path that is
used for actual network errors can be taken. This removes the need for any
extra retrying logic for this particular case.
This commit is contained in:
Markus Mäkelä
2018-11-13 17:20:50 +02:00
parent 37d38593d5
commit cab8a4bde8
3 changed files with 38 additions and 0 deletions

View File

@ -526,6 +526,15 @@ bool mxs_mysql_is_ok_packet(GWBUF* buffer);
*/
bool mxs_mysql_is_err_packet(GWBUF* buffer);
/**
* Extract the error code from an ERR packet
*
* @param buffer Buffer containing the ERR packet
*
* @return The error code or 0 if the buffer is not an ERR packet
*/
uint16_t mxs_mysql_get_mysql_errno(GWBUF* buffer);
/**
* @brief Check if a buffer contains a result set
*