MXS-2456: Cap transaction replay attempts

In most cases it is reasonable to stop attempting transaction replays
after a certain number of failed attempts. This prevents transactions from
being repeatedly replayed on the same server over and over again if, for
example, it keeps crashing.
This commit is contained in:
Markus Mäkelä
2019-04-30 13:45:48 +03:00
parent bc654849e8
commit 26b2897280
4 changed files with 26 additions and 20 deletions

View File

@ -343,6 +343,7 @@ private:
mxs::Buffer m_interrupted_query; /**< Query that was interrupted mid-transaction. */
Trx m_orig_trx; /**< The backup of the transaction we're replaying */
mxs::Buffer m_orig_stmt; /**< The backup of the statement that was interrupted */
int64_t m_num_trx_replays = 0; /**< How many times trx replay has been attempted */
otrx_state m_otrx_state = OTRX_INACTIVE; /**< Optimistic trx state*/