MXS-2587: Prevent queries after failed trx replay

If a transaction replay fails, no queries must be routed before the
connection is closed. This could happen if the client received the error
from the replay failure and closes the connection before the fake hangup
generated by the replay failure is processed.
This commit is contained in:
Markus Mäkelä 2019-07-03 13:42:14 +03:00
parent f36b6492ab
commit 953dd4098b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -472,14 +472,15 @@ void RWSplitSession::trx_replay_next_stmt()
else
{
MXS_INFO("Checksum mismatch, transaction replay failed. Closing connection.");
modutil_send_mysql_err_packet(m_client,
0,
0,
1927,
"08S01",
modutil_send_mysql_err_packet(m_client, 1, 0, 1927, "08S01",
"Transaction checksum mismatch encountered "
"when replaying transaction.");
poll_fake_hangup_event(m_client);
// Turn the replay flag back on to prevent queries from getting routed before the hangup we
// just added is processed. For example, this can happen if the error is sent and the client
// manages to send a COM_QUIT that gets processed before the fake hangup event.
m_is_replay_active = true;
}
}
else