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:
@ -160,6 +160,7 @@ struct Config
|
||||
, delayed_retry_timeout(params->get_duration<seconds>("delayed_retry_timeout").count())
|
||||
, transaction_replay(params->get_bool("transaction_replay"))
|
||||
, trx_max_size(params->get_size("transaction_replay_max_size"))
|
||||
, trx_max_attempts(params->get_integer("transaction_replay_attempts"))
|
||||
, optimistic_trx(params->get_bool("optimistic_trx"))
|
||||
, lazy_connect(params->get_bool("lazy_connect"))
|
||||
{
|
||||
@ -223,6 +224,7 @@ struct Config
|
||||
uint64_t delayed_retry_timeout; /**< How long to delay until an error is returned */
|
||||
bool transaction_replay; /**< Replay failed transactions */
|
||||
size_t trx_max_size; /**< Max transaction size for replaying */
|
||||
int64_t trx_max_attempts; /**< Maximum number of transaction replay attempts */
|
||||
bool optimistic_trx; /**< Enable optimistic transactions */
|
||||
bool lazy_connect; /**< Create connections only when needed */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user