Heuristic Recovery with the Transaction Coordinator Log

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.

Modes of Heuristic Recovery

There are three modes are heuristic recovery:

  • Automatic heuristic recovery after a crash.
  • Manual heuristic recovery when --tc-heuristic-recover is set.
  • No heuristic recovery.

Manual Heuristic Recovery

Manual heuristic recovery occurs when --tc-heuristic-recover is set. This might be needed if the server finds prepared transactions during crash recovery that are not in the transaction coordinator log. For example, you might see an error like this:

[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.


Comments loading...