Rechercher dans le manuel MySQL
17.4.1.31 Replication Retries and Timeouts
The global system variable
slave_transaction_retries
sets
the maximum number of times for applier threads on a
single-threaded or multithreaded replication slave to
automatically retry failed transactions before stopping.
Transactions are automatically retried when the SQL thread fails
to execute them because of an InnoDB
deadlock, or when the transaction's execution time exceeds the
InnoDB
innodb_lock_wait_timeout
value.
If a transaction has a non-temporary error that will prevent it
from ever succeeding, it is not retried.
The default setting for
slave_transaction_retries
is
10, meaning that a failing transaction with an apparently
temporary error is retried 10 times before the applier thread
stops. Setting the variable to 0 disables automatic retrying of
transactions. On a multithreaded slave, the specified number of
transaction retries can take place on all applier threads of all
channels. The Performance Schema table
replication_applier_status
shows
the total number of transaction retries that took place on each
replication channel, in the
COUNT_TRANSACTIONS_RETRIES
column.
The process of retrying transactions can cause lag on a
replication slave or on a Group Replication group member, which
can be configured as a single-threaded or multithreaded slave.
The Performance Schema table
replication_applier_status_by_worker
shows detailed information on transaction retries by the applier
threads on a single-threaded or multithreaded slave. This data
includes timestamps showing how long it took the applier thread
to apply the last transaction from start to finish (and when the
transaction currently in progress was started), and how long
this was after the commit on the original master and the
immediate master. The data also shows the number of retries for
the last transaction and the transaction currently in progress,
and enables you to identify the transient errors that caused the
transactions to be retried. You can use this information to see
whether transaction retries are the cause of replication lag,
and investigate the root cause of the failures that led to the
retries.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-replication-features-timeout.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.