Fix transaction replay timeout

The timeout would not be triggered due to the fact that the
delayed_retry_timeout wasn't inspected.
This commit is contained in:
Markus Mäkelä 2018-11-23 14:37:05 +02:00
parent 7bf5c07835
commit 842f9f1d15
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 7 additions and 1 deletions

View File

@ -330,7 +330,7 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
}
}
}
else if (can_retry_query() || m_is_replay_active)
else if (can_retry_query() || can_continue_trx_replay())
{
retry_query(gwbuf_clone(querybuf));
succp = true;

View File

@ -270,6 +270,12 @@ private:
&& !session_trx_is_active(m_client->session);
}
// Whether a transaction replay can remain active
inline bool can_continue_trx_replay() const
{
return m_is_replay_active && m_retry_duration < m_config.delayed_retry_timeout;
}
inline bool can_recover_servers() const
{
return !m_config.disable_sescmd_history || m_recv_sescmd == 0;