MySQL 8.4.2
Source Code Documentation
|
Transaction Coordinator Log. More...
#include <tc_log.h>
Public Types | |
enum | enum_result { RESULT_SUCCESS , RESULT_ABORTED , RESULT_INCONSISTENT } |
Public Member Functions | |
bool | using_heuristic_recover () |
Perform heuristic recovery, if –tc-heuristic-recover was used. More... | |
TC_LOG ()=default | |
virtual | ~TC_LOG ()=default |
virtual int | open (const char *opt_name)=0 |
Initialize and open the coordinator log. More... | |
virtual void | close ()=0 |
Close the transaction coordinator log and free any resources. More... | |
virtual enum_result | commit (THD *thd, bool all)=0 |
Log a commit record of the transaction to the transaction coordinator log. More... | |
virtual int | rollback (THD *thd, bool all)=0 |
Log a rollback record of the transaction to the transaction coordinator log. More... | |
virtual int | prepare (THD *thd, bool all)=0 |
Log a prepare record of the transaction to the storage engines. More... | |
Transaction Coordinator Log.
A base abstract class for three different implementations of the transaction coordinator.
The server uses the transaction coordinator to order transactions correctly and there are three different implementations: one using an in-memory structure, one dummy that does not do anything, and one using the binary log for transaction coordination.
enum TC_LOG::enum_result |
|
default |
|
virtualdefault |
|
pure virtual |
Close the transaction coordinator log and free any resources.
Called during server shutdown.
Implemented in MYSQL_BIN_LOG, TC_LOG_DUMMY, and TC_LOG_MMAP.
|
pure virtual |
Log a commit record of the transaction to the transaction coordinator log.
When the function returns, the transaction commit is properly logged to the transaction coordinator log and can be committed in the storage engines.
thd | Session to log transaction for. |
all | True if this is a "real" commit, false if it is a "statement" commit. |
Implemented in MYSQL_BIN_LOG, TC_LOG_DUMMY, and TC_LOG_MMAP.
|
pure virtual |
Initialize and open the coordinator log.
Do recovery if necessary. Called during server startup.
opt_name | Name of logfile. |
0 | success |
1 | failed |
Implemented in TC_LOG_DUMMY, MYSQL_BIN_LOG, and TC_LOG_MMAP.
|
pure virtual |
Log a prepare record of the transaction to the storage engines.
thd | Session to log transaction record for. |
all | true if an explicit commit or an implicit commit for a statement, false if an internal commit of the statement. |
Implemented in MYSQL_BIN_LOG, TC_LOG_DUMMY, and TC_LOG_MMAP.
|
pure virtual |
Log a rollback record of the transaction to the transaction coordinator log.
When the function returns, the transaction have been aborted in the transaction coordinator log.
thd | Session to log transaction record for. |
all | true if an explicit commit or an implicit commit for a statement, false if an internal commit of the statement. |
Implemented in MYSQL_BIN_LOG, TC_LOG_DUMMY, and TC_LOG_MMAP.
bool TC_LOG::using_heuristic_recover | ( | ) |
Perform heuristic recovery, if –tc-heuristic-recover was used.
false | no heuristic recovery was requested |
true | heuristic recovery was performed |