The transaction coordinator log (tc_log) is used to coordinate transactions that affect multiple XA-capable storage engines. One of the main purposes of this log is in crash recovery.
There are two modes of crash recovery:
Automatic crash recovery.
Manual heuristic recovery when is set to some value other than OFF.
Automatic crash recovery occurs during startup when MariaDB needs to recover from a crash and is set to OFF, which is the default value.
If MariaDB needs to perform automatic crash recovery and if the is enabled, then the will contain messages like this:
If MariaDB needs to perform automatic crash recovery and if the is not enabled, then the will contain messages like this:
Manual heuristic recovery occurs when is set to some value other than OFF. This might be needed if the server finds prepared transactions during crash recovery that are not in the transaction coordinator log. For example, the might contain an error like this:
When manual heuristic recovery is initiated, MariaDB will ignore information about transactions in the transaction coordinator log during the recovery process. Prepared transactions that are encountered during the recovery process will either be rolled back or committed, depending on the value of --tc-heuristic-recover.
When manual heuristic recovery is initiated, the will contain a message like this:
If is set to some value other than OFF and if the is enabled, then MariaDB will ignore information about transactions in the during the recovery process. Prepared transactions that are encountered during the recovery process will either be rolled back or committed, depending on the value of --tc-heuristic-recover.
After the recovery process is complete, MariaDB will create a new empty file, so that the old corrupt ones can be ignored.
If is set to some value other than OFF and if the is not enabled, then MariaDB will ignore information about transactions in the memory-mapped file defined by the option during the recovery process. Prepared transactions that are encountered during the recovery process will either be rolled back or committed, depending on the value of --tc-heuristic-recover.
This page is licensed: CC BY-SA / Gnu FDL
[Note] Recovering after a crash using cmdb-mariadb-0-bin
[Note] InnoDB: Buffer pool(s) load completed at 190313 11:24:29
[Note] Starting crash recovery...
[Note] Crash recovery finished.[Note] Recovering after a crash using tc.log
[Note] InnoDB: Buffer pool(s) load completed at 190313 11:26:32
[Note] Starting crash recovery...
[Note] Crash recovery finished.[ERROR] Found 1 prepared transactions! It means that mysqld was not shut down properly last time and critical recovery information (last binlog or tc.log file) was manually deleted after a crash. You have to start mysqld with --tc-heuristic-recover switch to commit or rollback pending transactions.[Note] Heuristic crash recovery mode