MySQL  8.0.19
Source Code Documentation
certifier.h File Reference

Go to the source code of this file.

Classes

class  Gtid_set_ref
 This class extends Gtid_set to include a reference counter. More...
 
class  Certifier_broadcast_thread
 
class  Certifier_interface
 
class  Certifier
 
class  Gtid_Executed_Message
 

Typedefs

typedef std::unordered_map< std::string, Gtid_set_ref * > Certification_info
 This class is a core component of the database state machine replication protocol. More...
 

Typedef Documentation

◆ Certification_info

typedef std::unordered_map<std::string, Gtid_set_ref *> Certification_info

This class is a core component of the database state machine replication protocol.

It implements conflict detection based on a certification procedure.

Snapshot Isolation is based on assigning logical timestamp to optimistic transactions, i.e. the ones which successfully meet certification and are good to commit on all members in the group. This timestamp is a monotonically increasing counter, and is same across all members in the group.

This timestamp, which in our algorithm is the snapshot version, is further used to update the certification info. The snapshot version maps the items in a transaction to the GTID_EXECUTED that this transaction saw when it was executed, that is, on which version the transaction was executed.

If the incoming transaction snapshot version is a subset of a previous certified transaction for the same write set, the current transaction was executed on top of outdated data, so it will be negatively certified. Otherwise, this transaction is marked certified and goes into applier.