MySQL 9.1.0
Source Code Documentation
|
This class is responsible for generating GTIDs in the Certifier. More...
#include <gtid_generator.h>
Public Member Functions | |
std::pair< rpl_gno, mysql::utils::Return_status > | get_next_available_gtid (const char *member_uuid, rpl_sidno sidno, const Gtid_set >id_set) |
This method is used to get the next valid GNO for the given sidno, for the transaction originating from the group member identified by the 'member_uuid'. More... | |
void | recompute (const Gtid_set >id_set) |
This function recomputes generator state. More... | |
void | initialize (uint64 gtid_assignment_block_size) |
This is initialization function that will be called in the certifier. More... | |
auto | get_gtid_assignment_block_size () const |
Accesses gtid assignment block size the Gtid_generator was initialized with. More... | |
Private Attributes | |
std::unordered_map< rpl_sidno, Gtid_generator_for_sidno > | m_gtid_generator_for_sidno |
GTID bookkeeping for each sidno. More... | |
uint64 | m_gtid_assignment_block_size = 1 |
The group GTID assignment block size. More... | |
This class is responsible for generating GTIDs in the Certifier.
Gtid certifier uses one instance of this class for generation of GTIDs. Gtid generator keeps track of free GTIDs for specific sidnos for each GR member. To achieve that, it consults gtid_set provided. When gtid generation is requested, GTID generator will reserve for each member a block of free GTIDS of size provided during the initialization (gtid_assignment_block_size). Recalculation of GTID blocks may be requested by the call to the "reset" function. New GTID may be generated by the call to the "get_next_available_gtid" function. Access to Gtid_generator must be synchronized by the user.
|
inline |
Accesses gtid assignment block size the Gtid_generator was initialized with.
std::pair< rpl_gno, mysql::utils::Return_status > gr::Gtid_generator::get_next_available_gtid | ( | const char * | member_uuid, |
rpl_sidno | sidno, | ||
const Gtid_set & | gtid_set | ||
) |
This method is used to get the next valid GNO for the given sidno, for the transaction originating from the group member identified by the 'member_uuid'.
This method may consult gtid_set for the list of available GTIDs
member_uuid | The UUID of the member from which this transaction originates. It will be NULL on View_change_log_event. |
sidno | The sidno that will be used on GTID |
gtid_set | Gtid set under consideration |
void gr::Gtid_generator::initialize | ( | uint64 | gtid_assignment_block_size | ) |
This is initialization function that will be called in the certifier.
gtid_assignment_block_size | This is the size of gtid assignment block |
void gr::Gtid_generator::recompute | ( | const Gtid_set & | gtid_set | ) |
This function recomputes generator state.
gtid_set | Gtid set under consideration |
|
private |
The group GTID assignment block size.
|
private |
GTID bookkeeping for each sidno.