24#ifndef GR_CERTIFICATION_gtid_generator_for_sidno_INCLUDED
25#define GR_CERTIFICATION_gtid_generator_for_sidno_INCLUDED
27#include <unordered_map>
56 const char *member_uuid,
const Gtid_set >id_set);
115 std::unordered_map<std::string, Gtid_set::Interval>;
Represents a set of GTIDs.
Definition: rpl_gtid.h:1557
Class that is responsible for holding available GTIDs and assigning GTID blocks to specific group mem...
Definition: gtid_generator_for_sidno.h:36
rpl_sidno m_sidno
Sidno for which this map has been created.
Definition: gtid_generator_for_sidno.h:136
std::list< Gtid_set::Interval > Interval_container_type
Interval container type, list of intervals.
Definition: gtid_generator_for_sidno.h:110
Gno_generation_result
Represents result of GNO generation function.
Definition: gtid_generator_for_sidno.h:74
@ gno_exhausted
gno exausted for the given sidno/uuid (error)
@ ok
successfully generated
@ error
Other error, such as OOM.
@ gtid_block_overflow
generated GNO > GNO_MAX defined for the current interval
std::pair< rpl_gno, Gno_generation_result > get_next_available_gtid_candidate(rpl_gno start, rpl_gno end, const Gtid_set >id_set) const
Generate the candidate GNO for the current transaction.
Definition: gtid_generator_for_sidno.cc:109
Assigned_intervals_container_type::iterator Assigned_intervals_it
Type of iterator of assigned_gtids.
Definition: gtid_generator_for_sidno.h:118
Assigned_intervals_container_type m_assigned_intervals
Holds currently assigned intervals for the given member.
Definition: gtid_generator_for_sidno.h:141
Interval_container_type m_available_intervals
Free intervals.
Definition: gtid_generator_for_sidno.h:139
Assigned_intervals_it get_assigned_interval(const std::string &member_uuid, const Gtid_set >id_set)
gets Interval assigned to the given member
Definition: gtid_generator_for_sidno.cc:187
long m_block_size
Block size used to assign GTIDs.
Definition: gtid_generator_for_sidno.h:137
std::pair< rpl_gno, mysql::utils::Return_status > get_next_available_gtid(const char *member_uuid, const Gtid_set >id_set)
Generates gno for transaction originating from server identified with the 'member_uuid' When needed,...
Definition: gtid_generator_for_sidno.cc:56
void compute_group_available_gtid_intervals(const Gtid_set >id_set)
For a given sidno, clear the assigned blocks for all members, and compute the available GTID interval...
Definition: gtid_generator_for_sidno.cc:142
Gtid_generator_for_sidno(rpl_sidno sidno, std::size_t block_size)
Constructs Gtid_generator_for_sidno for a given sidno and block_size.
Definition: gtid_generator_for_sidno.cc:104
std::size_t m_counter
The number of assigned GTIDs.
Definition: gtid_generator_for_sidno.h:138
Gtid_set::Interval reserve_gtid_block(longlong block_size, const Gtid_set >id_set)
This function reserves a block of GTIDs from the list of available GTIDs.
std::unordered_map< std::string, Gtid_set::Interval > Assigned_intervals_container_type
Container type hold currently assigned intervals (value) for the given member (key)
Definition: gtid_generator_for_sidno.h:115
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
long long int longlong
Definition: my_inttypes.h:55
Definition: group_replication_priv.h:44
mysql::gtid::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of mysql::gtid::gno_t.
Definition: rpl_gtid.h:113
cs::index::rpl_sidno rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:109
Represents one element in the linked list of intervals associated with a SIDNO.
Definition: rpl_gtid.h:2041