MySQL 8.4.0
Source Code Documentation
Recovery_metadata_message Class Reference

#include <recovery_metadata_message.h>

Inheritance diagram for Recovery_metadata_message:
[legend]

Public Types

enum  enum_payload_item_type {
  PIT_UNKNOWN = 0 , PIT_VIEW_ID = 1 , PIT_RECOVERY_METADATA_COMPRESSION_TYPE = 2 , PIT_UNTIL_CONDITION_AFTER_GTIDS = 3 ,
  PIT_COMPRESSED_CERTIFICATION_INFO_PACKET_COUNT = 4 , PIT_COMPRESSED_CERTIFICATION_INFO_PAYLOAD = 5 , PIT_COMPRESSED_CERTIFICATION_INFO_UNCOMPRESSED_LENGTH = 6 , PIT_RECOVERY_METADATA_MESSAGE_ERROR = 7 ,
  PIT_SENT_TIMESTAMP = 8 , PIT_MAX = 9
}
 Recovery Metadata message payload type. More...
 
enum  Recovery_metadata_message_payload_error { RECOVERY_METADATA_NO_ERROR = 0 , RECOVERY_METADATA_ERROR = 1 }
 Recovery Metadata message payload error. More...
 
enum class  enum_recovery_metadata_message_error {
  RECOVERY_METADATA_MESSAGE_OK , ERR_CERT_INFO_EMPTY , ERR_AFTER_GTID_SET_ENCODING , ERR_PAYLOAD_BUFFER_EMPTY ,
  ERR_PAYLOAD_TYPE_DECODING , ERR_PAYLOAD_DECODING , ERR_PAYLOAD_TYPE_NOT_DECODED , ERR_PAYLOAD_TYPE_UNKOWN
}
 Recovery Metadata message error. More...
 
- Public Types inherited from Plugin_gcs_message
enum  enum_cargo_type {
  CT_UNKNOWN = 0 , CT_CERTIFICATION_MESSAGE = 1 , CT_TRANSACTION_MESSAGE = 2 , CT_RECOVERY_MESSAGE = 3 ,
  CT_MEMBER_INFO_MESSAGE = 4 , CT_MEMBER_INFO_MANAGER_MESSAGE = 5 , CT_PIPELINE_STATS_MEMBER_MESSAGE = 6 , CT_SINGLE_PRIMARY_MESSAGE = 7 ,
  CT_GROUP_ACTION_MESSAGE = 8 , CT_GROUP_VALIDATION_MESSAGE = 9 , CT_SYNC_BEFORE_EXECUTION_MESSAGE = 10 , CT_TRANSACTION_WITH_GUARANTEE_MESSAGE = 11 ,
  CT_TRANSACTION_PREPARED_MESSAGE = 12 , CT_MESSAGE_SERVICE_MESSAGE = 13 , CT_RECOVERY_METADATA_MESSAGE = 14 , CT_MAX = 15
}
 The different cargo type codes. More...
 

Public Member Functions

 Recovery_metadata_message (const std::string &view_id, Recovery_metadata_message_payload_error error=RECOVERY_METADATA_NO_ERROR, GR_compress::enum_compression_type compression_type=GR_compress::enum_compression_type::ZSTD_COMPRESSION)
 Message constructor. More...
 
virtual ~Recovery_metadata_message () override
 Message destructor. More...
 
 Recovery_metadata_message (const uchar *buf, size_t len)
 Message constructor for raw data. More...
 
std::string & get_encode_view_id ()
 Return the message view_id which was generated when new member joined. More...
 
Recovery_metadata_message_payload_error get_encode_message_error ()
 Return the message error type. More...
 
void set_encode_message_error ()
 Set the message error type. More...
 
GR_compress::enum_compression_type get_encode_compression_type ()
 Return the compression type with which Certification Information compressed. More...
 
std::string & get_encode_group_gtid_executed ()
 Returns the gtid executed from the certification info map of the donor. More...
 
std::vector< GR_compress * > & get_encode_compressor_list ()
 Returns the compressed Certification Information divided in multiple elements of the vector. More...
 
void set_joining_members (std::vector< Gcs_member_identifier > &joining_members)
 Set members joining the view. More...
 
void set_valid_metadata_senders (std::vector< Gcs_member_identifier > &online_members)
 Set members ONLINE in the view. More...
 
void sort_valid_metadata_sender_list_using_uuid ()
 Set the vector m_valid_metadata_sender_list. More...
 
void set_metadata_sender (Gcs_member_identifier &sender_gcs_id)
 Set metadata sender. More...
 
bool donor_left ()
 Check if recovery metadata donor has left the group. More...
 
std::pair< bool, Gcs_member_identifiercompute_and_get_current_metadata_sender ()
 Compute the current metadata sender and return the GCS Member ID of the current metadata sender. More...
 
bool am_i_recovery_metadata_sender ()
 Checks if local member is metadata sender. More...
 
void delete_members_left (std::vector< Gcs_member_identifier > &member_left)
 Remove the members that left the group from the joining and valid sender list. More...
 
bool is_joiner_or_valid_sender_list_empty ()
 Return if joiner and valid metadata sender list is empty or not. More...
 
bool save_copy_of_recovery_metadata_payload ()
 Save copy of undecoded metadata, so it can be decoded and used later when required. More...
 
void delete_copy_of_recovery_metadata_payload ()
 Delete the saved copy of undecoded metadata. More...
 
void set_decoded_message_error ()
 Set the decoded message error type. More...
 
std::pair< enum_recovery_metadata_message_error, std::reference_wrapper< std::string > > get_decoded_view_id ()
 Return view_id generated when new member joined. More...
 
std::pair< enum_recovery_metadata_message_error, Recovery_metadata_message_payload_errorget_decoded_message_error ()
 Return the payload send message error received error in Recovery Metadata message. More...
 
std::pair< enum_recovery_metadata_message_error, GR_compress::enum_compression_typeget_decoded_compression_type ()
 Return the compression type with which Certification Information compressed in received Recovery Metadata message. More...
 
std::pair< enum_recovery_metadata_message_error, std::reference_wrapper< std::string > > get_decoded_group_gtid_executed ()
 Return the executed gtid set received from sender in received Recovery Metadata message. More...
 
std::pair< enum_recovery_metadata_message_error, unsigned int > get_decoded_compressed_certification_info_packet_count ()
 Return the Compressed Certification Info packet count received in Recovery Metadata message. More...
 
std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, unsigned long long, unsigned long long > get_decoded_compressed_certification_info_uncompressed_length (const unsigned char *payload_start_pos)
 Return the Certification Info packet's uncompressed_length i.e. More...
 
std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, const unsigned char *, unsigned long long > get_decoded_compressed_certification_info_payload (const unsigned char *payload_start_pos)
 Return the compressed Certification Info payload. More...
 
- Public Member Functions inherited from Plugin_gcs_message
virtual ~Plugin_gcs_message ()=default
 
int get_version ()
 
unsigned short get_header_length ()
 
enum_cargo_type get_cargo_type () const
 
unsigned long long get_msg_length ()
 
void encode (std::vector< unsigned char > *buffer) const
 Encodes the contents of this instance into the buffer. More...
 
void decode (const unsigned char *buffer, size_t length)
 Decodes the contents of the buffer and sets the field values according to the values decoded. More...
 

Static Public Member Functions

static uint64_t get_sent_timestamp (const unsigned char *buffer, size_t length)
 Return the time at which the message contained in the buffer was sent. More...
 
- Static Public Member Functions inherited from Plugin_gcs_message
static enum_cargo_type get_cargo_type (const unsigned char *buffer)
 Return the cargo type of a given message buffer, without decode the complete message. More...
 
static void get_first_payload_item_raw_data (const unsigned char *buffer, const unsigned char **payload_item_data, size_t *payload_item_length)
 Return the raw data of the first payload item of a given message buffer, without decode the complete message. More...
 
static bool get_payload_item_type_raw_data (const unsigned char *buffer, const unsigned char *end, uint16 payload_item_type, const unsigned char **payload_item_data, unsigned long long *payload_item_length)
 Return the raw data of the payload item of a given payload type of a given message buffer. More...
 

Public Attributes

std::map< int, std::string > m_payload_item_type_string
 Recovery Metadata message payload type name. More...
 

Protected Member Functions

void encode_payload (std::vector< unsigned char > *buffer) const override
 Encodes the message contents for transmission. More...
 
void decode_payload (const unsigned char *buffer, const unsigned char *end) override
 Message decoding method. More...
 
- Protected Member Functions inherited from Plugin_gcs_message
 Plugin_gcs_message (enum_cargo_type cargo_type)
 Plugin_gcs_message constructor. More...
 
void encode_header (std::vector< unsigned char > *buffer) const
 Encodes the header of this instance into the buffer. More...
 
void decode_header (const unsigned char **slider)
 Decodes the header of the buffer into this instance. More...
 
void encode_payload_item_type_and_length (std::vector< unsigned char > *buffer, uint16 payload_item_type, unsigned long long payload_item_length) const
 Encodes the given payload item type and length into the buffer. More...
 
void encode_payload_item_char (std::vector< unsigned char > *buffer, uint16 type, unsigned char value) const
 Encodes the given payload item (type, length and value) into the buffer as a char (1 byte). More...
 
void encode_payload_item_int2 (std::vector< unsigned char > *buffer, uint16 type, uint16 value) const
 Encodes the given payload item (type, length and value) into the buffer as a 2 bytes integer. More...
 
void decode_payload_item_int2 (const unsigned char **buffer, uint16 *type, uint16 *value)
 Decodes the given payload item (type, length and value) from the buffer as a 2 bytes integer. More...
 
void encode_payload_item_int4 (std::vector< unsigned char > *buffer, uint16 type, uint32 value) const
 Encodes the given payload item (type, length and value) into the buffer as a 4 bytes integer. More...
 
void decode_payload_item_int4 (const unsigned char **buffer, uint16 *type, uint32 *value)
 Decodes the given payload item (type, length and value) from the buffer as a 4 bytes integer. More...
 
void encode_payload_item_int8 (std::vector< unsigned char > *buffer, uint16 type, ulonglong value) const
 Encodes the given payload item (type, length and value) into the buffer as a 8 bytes integer. More...
 
void encode_payload_item_string (std::vector< unsigned char > *buffer, uint16 type, const char *value, unsigned long long length) const
 Encodes the given payload item (type, length and value) into the buffer as a char array (variable size). More...
 
void decode_payload_item_string (const unsigned char **buffer, uint16 *type, std::string *value, unsigned long long *length)
 Decodes the given payload item (type, length and value) from the buffer as a char array (variable size). More...
 
void encode_payload_item_bytes (std::vector< unsigned char > *buffer, uint16 type, const unsigned char *value, unsigned long long length) const
 Encodes the given payload item (type, length and value) into the buffer as a byte buffer (variable size). More...
 
void decode_payload_item_bytes (const unsigned char **buffer, uint16 *type, unsigned char *value, unsigned long long *length)
 Decodes the given payload item (type, length and value) from the buffer as a byte buffer (variable size). More...
 

Private Member Functions

bool encode_compressed_certification_info_payload (std::vector< unsigned char > *buffer) const
 Encodes the certification info for transmission. More...
 
std::tuple< enum_recovery_metadata_message_error, const unsigned char *, unsigned long long > decode_payload_type (int payload_type, const unsigned char *payload_start=nullptr) const
 Message decoding method to decode received metadata payload. More...
 

Private Attributes

std::string m_encode_view_id
 The view_id generated when new member joined. More...
 
Recovery_metadata_message_payload_error m_encode_metadata_message_error
 The enum_recovery_metadata_message_error message error type. More...
 
GR_compress::enum_compression_type m_encode_metadata_compression_type
 The compression type with which Certification Information compressed. More...
 
std::string m_encoded_group_gtid_executed {}
 The executed gtid set received from sender. More...
 
std::string m_decoded_view_id
 The view_id received from sender. More...
 
std::string m_decoded_group_gtid_executed {}
 The executed gtid set from sender. More...
 
std::pair< enum_recovery_metadata_message_error, std::reference_wrapper< std::string > > m_decoded_view_id_error
 The pair of <enum_recovery_metadata_message_error error, View ID>. More...
 
std::pair< enum_recovery_metadata_message_error, Recovery_metadata_message_payload_errorm_decoded_message_send_error
 The pair of <enum_recovery_metadata_message_error error, Recovery_metadata_message_payload_error payload_error>. More...
 
std::pair< enum_recovery_metadata_message_error, GR_compress::enum_compression_typem_decoded_compression_type_error
 The pair of <enum_recovery_metadata_message_error error, GR_compress::enum_compression_type>. More...
 
std::pair< enum_recovery_metadata_message_error, std::reference_wrapper< std::string > > m_decoded_group_gtid_executed_error
 The pair of <enum_recovery_metadata_message_error error, executed gtid set>. More...
 
std::pair< enum_recovery_metadata_message_error, unsigned int > m_decoded_certification_info_packet_count_error
 The pair of <enum_recovery_metadata_message_error error, Compress Certification Info packet count>. More...
 
std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, unsigned long long, unsigned long long > m_decoded_certification_info_uncompressed_length_error
 The tuple of <enum_recovery_metadata_message_error error, Certification Info packet uncompressed_length i.e. More...
 
std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, const unsigned char *, unsigned long long > m_decoded_compressed_certification_info_error
 The std::tuple of <enum_recovery_metadata_message_error error, compressed Certification Info packet, length of compressed Certification Info packet>. More...
 
std::vector< GR_compress * > m_encode_compressor_list
 The Certification Information in compressed and serialized format, used by the joining member for the recovery. More...
 
std::vector< Gcs_member_identifierm_members_joined_in_view
 The members joining in the view. More...
 
std::vector< Gcs_member_identifierm_valid_metadata_senders
 The members ONLINE in the view. More...
 
Gcs_member_identifier m_member_id_sending_metadata
 The GCS Member ID of the member sending recovery metadata. More...
 
const unsigned char * m_decode_metadata_buffer
 This pointer is added to start of buffer part which is yet to be decoded. More...
 
bool m_decode_is_metadata_buffer_local_copy {false}
 The metadata is broadcasted to all group members but only joiners require after_gtids and compressed certification info part of metadata which is processed by recovery thread, while view_id and metadata error part of metadata required by other members is processed by GCS thread. More...
 
const unsigned char * m_decode_metadata_end
 The end position of received metadata message payload. More...
 
size_t m_decode_metadata_length {0}
 The length of yet to be decoded part of buffer. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Plugin_gcs_message
static const int PLUGIN_GCS_MESSAGE_VERSION = 1
 The protocol version number. More...
 
static const unsigned int WIRE_VERSION_SIZE = 4
 The protocol version number. More...
 
static const unsigned int WIRE_HD_LEN_SIZE = 2
 The on-the-wire size of the header length field. More...
 
static const unsigned int WIRE_MSG_LEN_SIZE = 8
 The on-the-wire size of the message size field. More...
 
static const unsigned int WIRE_CARGO_TYPE_SIZE = 2
 The on-the-wire size of the cargo type field. More...
 
static const unsigned int WIRE_FIXED_HEADER_SIZE
 The on-the-wire size of the fixed header. More...
 
static const unsigned int WIRE_PAYLOAD_ITEM_TYPE_SIZE = 2
 The on-the-wire size of the each payload item type field. More...
 
static const unsigned int WIRE_PAYLOAD_ITEM_LEN_SIZE = 8
 The on-the-wire size of the each payload item size field. More...
 
static const unsigned int WIRE_PAYLOAD_ITEM_HEADER_SIZE
 The on-the-wire size of the payload item header. More...
 
- Static Protected Member Functions inherited from Plugin_gcs_message
static int64_t get_sent_timestamp (const unsigned char *buffer, size_t length, const uint16 timestamp_payload_item_type)
 Return the time at which the message contained in the buffer was sent. More...
 
static void decode_payload_item_type_and_length (const unsigned char **buffer, uint16 *payload_item_type, unsigned long long *payload_item_length)
 Decodes the given payload item type and length from the buffer. More...
 
static void decode_payload_item_char (const unsigned char **buffer, uint16 *type, unsigned char *value)
 Decodes the given payload item (type, length and value) from the buffer as a char (1 byte). More...
 
static void decode_payload_item_int8 (const unsigned char **buffer, uint16 *type, uint64 *value)
 Decodes the given payload item (type, length and value) from the buffer as a 8 bytes integer. More...
 

Member Enumeration Documentation

◆ enum_payload_item_type

Recovery Metadata message payload type.

Enumerator
PIT_UNKNOWN 
PIT_VIEW_ID 
PIT_RECOVERY_METADATA_COMPRESSION_TYPE 
PIT_UNTIL_CONDITION_AFTER_GTIDS 
PIT_COMPRESSED_CERTIFICATION_INFO_PACKET_COUNT 
PIT_COMPRESSED_CERTIFICATION_INFO_PAYLOAD 
PIT_COMPRESSED_CERTIFICATION_INFO_UNCOMPRESSED_LENGTH 
PIT_RECOVERY_METADATA_MESSAGE_ERROR 
PIT_SENT_TIMESTAMP 
PIT_MAX 

◆ enum_recovery_metadata_message_error

Recovery Metadata message error.

Enumerator
RECOVERY_METADATA_MESSAGE_OK 
ERR_CERT_INFO_EMPTY 
ERR_AFTER_GTID_SET_ENCODING 
ERR_PAYLOAD_BUFFER_EMPTY 
ERR_PAYLOAD_TYPE_DECODING 
ERR_PAYLOAD_DECODING 
ERR_PAYLOAD_TYPE_NOT_DECODED 
ERR_PAYLOAD_TYPE_UNKOWN 

◆ Recovery_metadata_message_payload_error

Recovery Metadata message payload error.

Enumerator
RECOVERY_METADATA_NO_ERROR 
RECOVERY_METADATA_ERROR 

Constructor & Destructor Documentation

◆ Recovery_metadata_message() [1/2]

Recovery_metadata_message::Recovery_metadata_message ( const std::string &  view_id,
Recovery_metadata_message_payload_error  error = RECOVERY_METADATA_NO_ERROR,
GR_compress::enum_compression_type  compression_type = GR_compress::enum_compression_type::ZSTD_COMPRESSION 
)

Message constructor.

Parameters
[in]view_idthe view_id generated when new member joined
[in]errorthe message error type
[in]compression_typethe compression type with which Certification Information compressed

◆ ~Recovery_metadata_message()

Recovery_metadata_message::~Recovery_metadata_message ( )
overridevirtual

Message destructor.

◆ Recovery_metadata_message() [2/2]

Recovery_metadata_message::Recovery_metadata_message ( const uchar buf,
size_t  len 
)

Message constructor for raw data.

Parameters
[in]bufraw data
[in]lenraw length

Member Function Documentation

◆ am_i_recovery_metadata_sender()

bool Recovery_metadata_message::am_i_recovery_metadata_sender ( )

Checks if local member is metadata sender.

Note
: compute_and_get_current_metadata_sender should be called before this function to make sure metadata sender is updated. Since am_i_recovery_metadata_sender will be called many times, compute of the current metadata sender has been separated into compute_and_get_current_metadata_sender.
Returns
the status if local member is metadata sender.
Return values
falselocal member is recovery metadata sender.
truelocal member is not recovery metadata sender.

◆ compute_and_get_current_metadata_sender()

std::pair< bool, Gcs_member_identifier > Recovery_metadata_message::compute_and_get_current_metadata_sender ( )

Compute the current metadata sender and return the GCS Member ID of the current metadata sender.

Returns
the Gcs_member_identifier of the current sender

◆ decode_payload()

void Recovery_metadata_message::decode_payload ( const unsigned char *  buffer,
const unsigned char *  end 
)
overrideprotectedvirtual

Message decoding method.

Parameters
[in]bufferthe received data
[in]endthe end of the buffer

Implements Plugin_gcs_message.

◆ decode_payload_type()

std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, const unsigned char *, unsigned long long > Recovery_metadata_message::decode_payload_type ( int  payload_type,
const unsigned char *  payload_start = nullptr 
) const
private

Message decoding method to decode received metadata payload.

The metadata is broadcasted to all group members but only joiners require after_gtids and compressed certification info part of metadata. And on all other members only require view_id and metadata error part of metadata.

Parameters
[in]payload_typethe payload type to be decoded
[in]payload_startIf payload_start is provided then payload types are search from that position
Returns
the std::pair of payload type and enum_recovery_metadata_message_error error type.

◆ delete_copy_of_recovery_metadata_payload()

void Recovery_metadata_message::delete_copy_of_recovery_metadata_payload ( )

Delete the saved copy of undecoded metadata.

◆ delete_members_left()

void Recovery_metadata_message::delete_members_left ( std::vector< Gcs_member_identifier > &  member_left)

Remove the members that left the group from the joining and valid sender list.

Parameters
[in]member_leftAll GCS Member ID that left the group.

◆ donor_left()

bool Recovery_metadata_message::donor_left ( )

Check if recovery metadata donor has left the group.

Returns
the recovery metadata send status
Return values
truedonor left the group
falsedonor is still on the group true donor left

◆ encode_compressed_certification_info_payload()

bool Recovery_metadata_message::encode_compressed_certification_info_payload ( std::vector< unsigned char > *  buffer) const
private

Encodes the certification info for transmission.

Parameters
[out]bufferthe buffer to encode to
Returns
the operation status
Return values
falseOK
trueError

◆ encode_payload()

void Recovery_metadata_message::encode_payload ( std::vector< unsigned char > *  buffer) const
overrideprotectedvirtual

Encodes the message contents for transmission.

Parameters
[out]bufferthe message buffer to be written

Implements Plugin_gcs_message.

◆ get_decoded_compressed_certification_info_packet_count()

std::pair< Recovery_metadata_message::enum_recovery_metadata_message_error, unsigned int > Recovery_metadata_message::get_decoded_compressed_certification_info_packet_count ( )

Return the Compressed Certification Info packet count received in Recovery Metadata message.

If the Compressed Certification Info packet count was already decoded earlier it returns saved value.

Returns
the std::pair of <enum_recovery_metadata_message_error error, Compress Certification Info packet count>.

◆ get_decoded_compressed_certification_info_payload()

std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, const unsigned char *, unsigned long long > Recovery_metadata_message::get_decoded_compressed_certification_info_payload ( const unsigned char *  payload_start_pos)

Return the compressed Certification Info payload.

The Recovery Metadata message can have multiple packets of Compressed Certification Info. If the start position argument is provided the next compressed Certification Info packet type i.e. PIT_COMPRESSED_CERTIFICATION_INFO_PAYLOAD packet type is searched and fetched after that position.

Parameters
[in]payload_start_posthe next compressed Certification Info packet packet type is searched and fetched after the position.
Returns
the std::tuple of <enum_recovery_metadata_message_error error, compressed Certification Info packet, length of compressed Certification Info packet>.

◆ get_decoded_compressed_certification_info_uncompressed_length()

std::tuple< Recovery_metadata_message::enum_recovery_metadata_message_error, unsigned long long, unsigned long long > Recovery_metadata_message::get_decoded_compressed_certification_info_uncompressed_length ( const unsigned char *  payload_start_pos)

Return the Certification Info packet's uncompressed_length i.e.

size of packet before compression. The Recovery Metadata message can have multiple packets of Compressed Certification Info. If the start position argument is provided the next Certification Info packet uncompressed_length packet type i.e. PIT_COMPRESSED_CERTIFICATION_INFO_UNCOMPRESSED_LENGTH packet type is searched and fetched after that position.

Parameters
[in]payload_start_posthe next Certification Info packet uncompressed_length packet type is searched and fetched after the position.
Returns
the std::tuple of <enum_recovery_metadata_message_error error, Certification Info packet uncompressed_length i.e. size of packet before compression, length of uncompressed_length payload>.

◆ get_decoded_compression_type()

std::pair< Recovery_metadata_message::enum_recovery_metadata_message_error, GR_compress::enum_compression_type > Recovery_metadata_message::get_decoded_compression_type ( )

Return the compression type with which Certification Information compressed in received Recovery Metadata message.

If the compression type was already decoded earlier it returns saved compression type value.

Returns
the std::pair of <enum_recovery_metadata_message_error error, GR_compress::enum_compression_type>.

◆ get_decoded_group_gtid_executed()

std::pair< Recovery_metadata_message::enum_recovery_metadata_message_error, std::reference_wrapper< std::string > > Recovery_metadata_message::get_decoded_group_gtid_executed ( )

Return the executed gtid set received from sender in received Recovery Metadata message.

If the executed gtid set was already decoded earlier it returns saved executed gtid set value.

Returns
the std::pair of <enum_recovery_metadata_message_error error, executed gtid set>.

◆ get_decoded_message_error()

Return the payload send message error received error in Recovery Metadata message.

If the payload send message error was decoded earlier it return saved error value.

Returns
the std::pair of <enum_recovery_metadata_message_error error, Recovery_metadata_message_payload_error payload_error>.

◆ get_decoded_view_id()

std::pair< Recovery_metadata_message::enum_recovery_metadata_message_error, std::reference_wrapper< std::string > > Recovery_metadata_message::get_decoded_view_id ( )

Return view_id generated when new member joined.

Decodes and return view_id generated when new member joined. If the view_id was decoded earlier it return saved view_id value.

Returns
the std::pair of <enum_recovery_metadata_message_error error type, refernce to View ID string>

◆ get_encode_compression_type()

GR_compress::enum_compression_type Recovery_metadata_message::get_encode_compression_type ( )

Return the compression type with which Certification Information compressed.

Returns
the GR_compress::enum_compression_type compression type.

◆ get_encode_compressor_list()

std::vector< GR_compress * > & Recovery_metadata_message::get_encode_compressor_list ( )

Returns the compressed Certification Information divided in multiple elements of the vector.

Returns
the reference to vector containing compressed Certification Information.

◆ get_encode_group_gtid_executed()

std::string & Recovery_metadata_message::get_encode_group_gtid_executed ( )

Returns the gtid executed from the certification info map of the donor.

It is the set of transactions that is executed at the time of view change at donor.

Returns
the reference to string containing the gtid executed from the certification info map of the donor.

◆ get_encode_message_error()

Recovery_metadata_message::Recovery_metadata_message_payload_error Recovery_metadata_message::get_encode_message_error ( )

Return the message error type.

Returns
the Recovery_metadata_message_payload_error message error.

◆ get_encode_view_id()

std::string & Recovery_metadata_message::get_encode_view_id ( )

Return the message view_id which was generated when new member joined.

Returns
the view_id which was generated when new member joined.

◆ get_sent_timestamp()

uint64_t Recovery_metadata_message::get_sent_timestamp ( const unsigned char *  buffer,
size_t  length 
)
static

Return the time at which the message contained in the buffer was sent.

See also
Metrics_handler::get_current_time()
Parameters
[in]bufferthe buffer to decode from.
[in]lengththe buffer length
Returns
the time on which the message was sent.

◆ is_joiner_or_valid_sender_list_empty()

bool Recovery_metadata_message::is_joiner_or_valid_sender_list_empty ( )

Return if joiner and valid metadata sender list is empty or not.

If any of the list is empty true is return.

Returns
the recovery metadata send status
Return values
falseAtleast 1 joiner and valid metadata sender is present in group
trueEither there are no joiner or valid metadata sender

◆ save_copy_of_recovery_metadata_payload()

bool Recovery_metadata_message::save_copy_of_recovery_metadata_payload ( )

Save copy of undecoded metadata, so it can be decoded and used later when required.

The metadata is broadcasted to all group members but only joiners require after_gtids and compressed certification info part of metadata. And on all other members only require view_id and metadata error part of metadata. The view id and metadata error part only is decoded by GCS thread. Only joiner require this rest of metadata part for receovery and processing on GCS thread will block it for longer duration, so it's copy is saved in this function and decoded by recovery thread.

Returns
the status showing metadata message second part saved success.
Return values
falseOK
trueError

◆ set_decoded_message_error()

void Recovery_metadata_message::set_decoded_message_error ( )

Set the decoded message error type.

◆ set_encode_message_error()

void Recovery_metadata_message::set_encode_message_error ( )

Set the message error type.

◆ set_joining_members()

void Recovery_metadata_message::set_joining_members ( std::vector< Gcs_member_identifier > &  joining_members)

Set members joining the view.

Parameters
[in]joining_membersmembers joining the view

◆ set_metadata_sender()

void Recovery_metadata_message::set_metadata_sender ( Gcs_member_identifier sender_gcs_id)

Set metadata sender.

Parameters
[in]sender_gcs_idGCS Member ID of the sender.

◆ set_valid_metadata_senders()

void Recovery_metadata_message::set_valid_metadata_senders ( std::vector< Gcs_member_identifier > &  online_members)

Set members ONLINE in the view.

Parameters
[in]online_membersmembers ONLINE in view

◆ sort_valid_metadata_sender_list_using_uuid()

void Recovery_metadata_message::sort_valid_metadata_sender_list_using_uuid ( )

Set the vector m_valid_metadata_sender_list.

Member Data Documentation

◆ m_decode_is_metadata_buffer_local_copy

bool Recovery_metadata_message::m_decode_is_metadata_buffer_local_copy {false}
private

The metadata is broadcasted to all group members but only joiners require after_gtids and compressed certification info part of metadata which is processed by recovery thread, while view_id and metadata error part of metadata required by other members is processed by GCS thread.

The processing of after_gtids and compressed certification info on GCS thread will block it for longer duration, so it's copy is saved in this

◆ m_decode_metadata_buffer

const unsigned char* Recovery_metadata_message::m_decode_metadata_buffer
private

This pointer is added to start of buffer part which is yet to be decoded.

The buffer is the metadata message payload received from metadata sender members consisting of after_gtids, compressed certification info payload.

◆ m_decode_metadata_end

const unsigned char* Recovery_metadata_message::m_decode_metadata_end
private

The end position of received metadata message payload.

◆ m_decode_metadata_length

size_t Recovery_metadata_message::m_decode_metadata_length {0}
private

The length of yet to be decoded part of buffer.

The buffer is the metadata message payload received from metadata sender members consisting of after_gtids, compressed certification info payload.

◆ m_decoded_certification_info_packet_count_error

std::pair<enum_recovery_metadata_message_error, unsigned int> Recovery_metadata_message::m_decoded_certification_info_packet_count_error
private
Initial value:

The pair of <enum_recovery_metadata_message_error error, Compress Certification Info packet count>.

The Compress Certification Info packet count is the number of compressed Certification Info packets received from the Recovery Metadata sender.

◆ m_decoded_certification_info_uncompressed_length_error

std::tuple<Recovery_metadata_message::enum_recovery_metadata_message_error, unsigned long long, unsigned long long> Recovery_metadata_message::m_decoded_certification_info_uncompressed_length_error
private

The tuple of <enum_recovery_metadata_message_error error, Certification Info packet uncompressed_length i.e.

size of packet before compression, length of uncompressed_length payload>.

◆ m_decoded_compressed_certification_info_error

std::tuple<Recovery_metadata_message::enum_recovery_metadata_message_error, const unsigned char *, unsigned long long> Recovery_metadata_message::m_decoded_compressed_certification_info_error
private

The std::tuple of <enum_recovery_metadata_message_error error, compressed Certification Info packet, length of compressed Certification Info packet>.

◆ m_decoded_compression_type_error

std::pair<enum_recovery_metadata_message_error, GR_compress::enum_compression_type> Recovery_metadata_message::m_decoded_compression_type_error
private
Initial value:

The pair of <enum_recovery_metadata_message_error error, GR_compress::enum_compression_type>.

The compression type with which Certification Information compressed.

◆ m_decoded_group_gtid_executed

std::string Recovery_metadata_message::m_decoded_group_gtid_executed {}
private

The executed gtid set from sender.

◆ m_decoded_group_gtid_executed_error

std::pair<enum_recovery_metadata_message_error, std::reference_wrapper<std::string> > Recovery_metadata_message::m_decoded_group_gtid_executed_error
private

The pair of <enum_recovery_metadata_message_error error, executed gtid set>.

The executed gtid set is received from sender.

◆ m_decoded_message_send_error

std::pair<enum_recovery_metadata_message_error, Recovery_metadata_message_payload_error> Recovery_metadata_message::m_decoded_message_send_error
private
Initial value:

The pair of <enum_recovery_metadata_message_error error, Recovery_metadata_message_payload_error payload_error>.

The payload error is received error in Recovery Metadata message and determines errors while delivering message to group.

◆ m_decoded_view_id

std::string Recovery_metadata_message::m_decoded_view_id
private

The view_id received from sender.

◆ m_decoded_view_id_error

std::pair<enum_recovery_metadata_message_error, std::reference_wrapper<std::string> > Recovery_metadata_message::m_decoded_view_id_error
private

The pair of <enum_recovery_metadata_message_error error, View ID>.

The View ID generated when new member joined.

◆ m_encode_compressor_list

std::vector<GR_compress *> Recovery_metadata_message::m_encode_compressor_list
mutableprivate

The Certification Information in compressed and serialized format, used by the joining member for the recovery.

◆ m_encode_metadata_compression_type

GR_compress::enum_compression_type Recovery_metadata_message::m_encode_metadata_compression_type
private

The compression type with which Certification Information compressed.

◆ m_encode_metadata_message_error

Recovery_metadata_message_payload_error Recovery_metadata_message::m_encode_metadata_message_error
private

The enum_recovery_metadata_message_error message error type.

◆ m_encode_view_id

std::string Recovery_metadata_message::m_encode_view_id
private

The view_id generated when new member joined.

◆ m_encoded_group_gtid_executed

std::string Recovery_metadata_message::m_encoded_group_gtid_executed {}
private

The executed gtid set received from sender.

◆ m_member_id_sending_metadata

Gcs_member_identifier Recovery_metadata_message::m_member_id_sending_metadata
private

The GCS Member ID of the member sending recovery metadata.

◆ m_members_joined_in_view

std::vector<Gcs_member_identifier> Recovery_metadata_message::m_members_joined_in_view
private

The members joining in the view.

◆ m_payload_item_type_string

std::map<int, std::string> Recovery_metadata_message::m_payload_item_type_string
Initial value:
{
{PIT_UNKNOWN, "Unknown Type"},
{PIT_VIEW_ID, "View ID"},
{PIT_UNTIL_CONDITION_AFTER_GTIDS, "Executed Gtid Set"},
"Compressed Certification Info Packet Count"},
"Compressed Certification Info Payload"},
"Certification Info packet ucompressed length"},
{PIT_RECOVERY_METADATA_MESSAGE_ERROR, "Sender Message Error"},
{PIT_SENT_TIMESTAMP, "Sent Timestamp"}}
@ PIT_RECOVERY_METADATA_COMPRESSION_TYPE
Definition: recovery_metadata_message.h:47
@ PIT_COMPRESSED_CERTIFICATION_INFO_PAYLOAD
Definition: recovery_metadata_message.h:53
@ PIT_COMPRESSED_CERTIFICATION_INFO_UNCOMPRESSED_LENGTH
Definition: recovery_metadata_message.h:55
@ PIT_SENT_TIMESTAMP
Definition: recovery_metadata_message.h:59
@ PIT_COMPRESSED_CERTIFICATION_INFO_PACKET_COUNT
Definition: recovery_metadata_message.h:51
@ PIT_UNTIL_CONDITION_AFTER_GTIDS
Definition: recovery_metadata_message.h:49
@ PIT_UNKNOWN
Definition: recovery_metadata_message.h:43
@ PIT_VIEW_ID
Definition: recovery_metadata_message.h:45
@ PIT_RECOVERY_METADATA_MESSAGE_ERROR
Definition: recovery_metadata_message.h:57

Recovery Metadata message payload type name.

◆ m_valid_metadata_senders

std::vector<Gcs_member_identifier> Recovery_metadata_message::m_valid_metadata_senders
private

The members ONLINE in the view.


The documentation for this class was generated from the following files: