MySQL 8.0.39
Source Code Documentation
|
Class that conveys the state to be exchanged between members, which is not provided by XCom. More...
#include <gcs_xcom_state_exchange.h>
Public Member Functions | |
Xcom_member_state (const Gcs_xcom_view_identifier &view_id, synode_no configuration_id, Gcs_protocol_version version, const Gcs_xcom_synode_set &snapshot, const uchar *data, uint64_t data_size) | |
Xcom_member_state constructor. More... | |
Xcom_member_state (Gcs_protocol_version version, const uchar *data, uint64_t data_size) | |
Xcom_member_state constructor. More... | |
~Xcom_member_state () | |
Member state destructor. More... | |
bool | encode_header (uchar *buffer, uint64_t *buffer_len) const |
Encodes the Member State's header to be sent through the newtwork. More... | |
bool | decode_header (const uchar *buffer, uint64_t buffer_len) |
Decodes the Member State's header that was sent through the network. More... | |
bool | encode_snapshot (uchar *buffer, uint64_t *buffer_len) const |
Encodes the Member State's snapshot to be sent through the network. More... | |
bool | decode_snapshot (const uchar *buffer, uint64_t buffer_len) |
Decodes the Member State's snapshot that was sent through the network. More... | |
bool | decode (const uchar *data, uint64_t data_size) |
Decodes Member State that was sent through the network. More... | |
uint64_t | get_encode_payload_size () const |
uint64_t | get_encode_snapshot_size () const |
Gcs_xcom_view_identifier * | get_view_id () |
synode_no | get_configuration_id () const |
const uchar * | get_data () const |
uint64_t | get_data_size () const |
const Gcs_xcom_synode_set & | get_snapshot () const |
Static Public Member Functions | |
static constexpr uint64_t | get_encode_header_size () |
Private Member Functions | |
Xcom_member_state (Xcom_member_state const &)=delete | |
Xcom_member_state & | operator= (Xcom_member_state const &)=delete |
Static Private Member Functions | |
static constexpr uint64_t | get_encode_snapshot_elem_size () |
Private Attributes | |
Gcs_xcom_view_identifier * | m_view_id |
synode_no | m_configuration_id |
uchar * | m_data |
uint64_t | m_data_size |
Gcs_xcom_synode_set | m_snapshot |
Recovery information which is currently a list of the XCom synods of the fragments that are in buffers when a node is joining. More... | |
Gcs_protocol_version | m_version |
GCS communication version number in use. More... | |
Static Private Attributes | |
static constexpr auto | WIRE_XCOM_VARIABLE_VIEW_ID_SIZE = 8 |
static constexpr auto | WIRE_XCOM_VIEW_ID_SIZE = 4 |
static constexpr auto | WIRE_XCOM_GROUP_ID_SIZE = 4 |
static constexpr auto | WIRE_XCOM_MSG_ID_SIZE = 8 |
static constexpr auto | WIRE_XCOM_NODE_ID_SIZE = 4 |
static constexpr auto | WIRE_XCOM_SNAPSHOT_NR_ELEMS_SIZE = 8 |
Class that conveys the state to be exchanged between members, which is not provided by XCom.
In the original GCS protocol (version 1), this message had the following wire format:
+--------+---------------------+ | Header | Upper-layer payload | +--------+---------------------+
Where the header has the following format:
+---------+------------+ | View ID | XCom synod | +---------+------------+
With the introduction of the fragmentation stage into the message pipeline, it is possible that an original message is fragmented into several fragments, and each fragment is delivered by XCom individually.
This means that when a node joins, it is possible for the transmission of a fragmented message to be ongoing, i.e. the existing group members have already received some, but not all, of the fragments. In this situation, the last fragment will arrive after the new node has joined the group. Since the original message is only delivered when all its fragments are received, this means that the original message will need to be delivered by the new node as well. But the problem is that new node does not have the fragments that were received before the new node joined.
We solve this problem by augmenting the state exchange message with information about the ongoing transmission of fragmented messages. In particular, for every fragmented message whose transmission is ongoing, a node will attach the XCom synods of the fragments it has already received. The new node can use this information to fetch the fragments from XCom.
As such, in GCS protocol version 2, this message has the following wire format:
+--------+---------------------+----------------+ | Header | Upper-layer payload | Recovery info. | +--------+---------------------+----------------+
Where the recovery information has the following format:
+---------------+-...-+----------------+------------+ | XCom synod #1 | | XCom synode #n | Nr. synods | +---------------+-...-+----------------+------------+
Older GCS instances that only support protocol version 1 will deserialize the recovery information as part of the upper-layer payload. However, this works as long as the upper layer consumes only the portion it is expecting (upper-layer payload), even though it is fed its expected payload with the recovery information appended.
|
explicit |
Xcom_member_state constructor.
[in] | view_id | the view identifier from the node |
[in] | configuration_id | Configuration identifier in use when the state exchange message was created |
[in] | version | Protocol version used to represent the state |
[in] | snapshot | Snapshot information currently in use |
[in] | data | the generic data to be exchanged |
[in] | data_size | data's size |
|
explicit |
Xcom_member_state constructor.
[in] | version | Protocol version used to represent the state |
[in] | data | the generic data to be exchanged |
[in] | data_size | data's size |
Xcom_member_state::~Xcom_member_state | ( | ) |
Member state destructor.
|
privatedelete |
bool Xcom_member_state::decode | ( | const uchar * | data, |
uint64_t | data_size | ||
) |
Decodes Member State that was sent through the network.
[out] | data | where the data was stored. |
[out] | data_size | pointer to the variable that holds the data's size. |
bool Xcom_member_state::decode_header | ( | const uchar * | buffer, |
uint64_t | buffer_len | ||
) |
Decodes the Member State's header that was sent through the network.
[out] | buffer | Where the header was stored. |
[in,out] | buffer_len | Pointer to the variable that holds the header's size and has the buffer's len as input. |
bool Xcom_member_state::decode_snapshot | ( | const uchar * | buffer, |
uint64_t | buffer_len | ||
) |
Decodes the Member State's snapshot that was sent through the network.
[out] | buffer | Where the snapshot was stored. |
[in,out] | buffer_len | It holds the snapshot's size. |
bool Xcom_member_state::encode_header | ( | uchar * | buffer, |
uint64_t * | buffer_len | ||
) | const |
Encodes the Member State's header to be sent through the newtwork.
[out] | buffer | where the header will be stored. |
[in,out] | buffer_len | pointer to the variable that will hold the header's size and has the buffer's len as input. |
bool Xcom_member_state::encode_snapshot | ( | uchar * | buffer, |
uint64_t * | buffer_len | ||
) | const |
Encodes the Member State's snapshot to be sent through the network.
[out] | buffer | where the snapshot will be stored. |
[in,out] | buffer_len | pointer to the variable that will hold the snapshot's size and has the buffer's len as input. |
|
inline |
|
inline |
|
inline |
|
inlinestaticconstexpr |
uint64_t Xcom_member_state::get_encode_payload_size | ( | ) | const |
|
inlinestaticconstexprprivate |
uint64_t Xcom_member_state::get_encode_snapshot_size | ( | ) | const |
|
inline |
|
inline |
|
privatedelete |
|
private |
|
private |
|
private |
|
private |
Recovery information which is currently a list of the XCom synods of the fragments that are in buffers when a node is joining.
This is currently used only to transfer information on slice packets that need to be fetched by the joining node before it may become ready to serve requests.
|
private |
GCS communication version number in use.
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |