36#ifndef CONTROL_EVENT_INCLUDED
37#define CONTROL_EVENT_INCLUDED
130 unsigned int flags_arg, uint64_t pos_arg)
133 ident_len(ident_len_arg ? ident_len_arg : strlen(new_log_ident_arg)),
158 void print_event_info(std::ostream &)
override;
159 void print_long_info(std::ostream &)
override;
339 void print_event_info(std::ostream &
info)
override;
340 void print_long_info(std::ostream &
info)
override;
389 void print_event_info(std::ostream &)
override {}
390 void print_long_info(std::ostream &
info)
override;
477 void print_event_info(std::ostream &
info)
override;
478 void print_long_info(std::ostream &
info)
override;
533 void print_event_info(std::ostream &
info)
override;
534 void print_long_info(std::ostream &
info)
override;
625 void print_event_info(std::ostream &)
override {}
626 void print_long_info(std::ostream &)
override {}
682 void print_event_info(std::ostream &)
override {}
683 void print_long_info(std::ostream &)
override {}
799 uint16_t compression_type,
800 uint64_t uncompressed_size);
886 void print_event_info(std::ostream &)
override;
887 void print_long_info(std::ostream &)
override;
1024 long long int sequence_number_arg,
1025 bool may_have_sbr_stmts_arg,
1026 unsigned long long int original_commit_timestamp_arg,
1027 unsigned long long int immediate_commit_timestamp_arg,
1028 uint32_t original_server_version_arg,
1029 uint32_t immediate_server_version_arg)
1042 void print_event_info(std::ostream &)
override {}
1043 void print_long_info(std::ostream &)
override {}
1174 std::uint64_t value);
1232 void print_event_info(std::ostream &)
override {}
1233 void print_long_info(std::ostream &)
override {}
1312 bool is_gtid_specified_arg)
1320 std::list<const char *> *
set,
1321 uint32_t remaining_buffer);
1326 void print_event_info(std::ostream &)
override {}
1327 void print_long_info(std::ostream &)
override {}
1417 void print_event_info(std::ostream &)
override {}
1418 void print_long_info(std::ostream &)
override {}
1530 void print_event_info(std::ostream &
info)
override;
1531 void print_long_info(std::ostream &
info)
override;
Contains the classes representing events occurring in the replication stream.
#define LOG_EVENT_HEADER_LEN
Definition: binlog_event.h:406
#define LOG_EVENT_MINIMAL_HEADER_LEN
Fixed header length, where 4.x and 5.0 agree.
Definition: binlog_event.h:415
#define ST_SERVER_VER_LEN
The length of the array server_version, which is used to store the version of MySQL server.
Definition: binlog_event.h:388
This is the abstract base class for binary log events.
Definition: binlog_event.h:806
GTID stands for Global Transaction IDentifier It is composed of two parts:
Definition: control_events.h:980
long long int sequence_number
Definition: control_events.h:989
static const int POST_HEADER_LENGTH
Total length of post header.
Definition: control_events.h:1117
static const int LOGICAL_TIMESTAMP_TYPECODE_LENGTH
Length of typecode for logical timestamps.
Definition: control_events.h:1062
static const int ENCODED_GNO_LENGTH
Definition: control_events.h:1060
virtual std::int64_t get_gno() const
Definition: control_events.h:1114
static const int LOGICAL_TIMESTAMP_TYPECODE
Definition: control_events.h:1066
static const int ENCODED_SERVER_VERSION_LENGTH
Definition: control_events.h:1086
bool may_have_sbr_stmts
Transaction might have changes logged with SBR.
Definition: control_events.h:993
static const int ORIGINAL_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1069
static const int TRANSACTION_LENGTH_MIN_LENGTH
Definition: control_events.h:1076
Uuid get_uuid() const
Definition: control_events.h:1115
uint32_t original_server_version
The version of the server where the transaction was originally executed.
Definition: control_events.h:1150
unsigned long long int original_commit_timestamp
Timestamp when the transaction was committed on the originating master.
Definition: control_events.h:995
static const int ORIGINAL_SERVER_VERSION_LENGTH
Length of original_server_version.
Definition: control_events.h:1079
int get_commit_group_ticket_length() const
Returns the length of the packed commit_group_ticket field.
Definition: control_events.cpp:575
unsigned long long int immediate_commit_timestamp
Timestamp when the transaction was committed on the nearest master.
Definition: control_events.h:997
static const int ENCODED_SID_LENGTH
Definition: control_events.h:1059
int get_server_version_length() const
We only store the immediate_server_version if both server versions are the same.
Definition: control_events.h:1099
static const int FULL_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1071
static const int TRANSACTION_LENGTH_MAX_LENGTH
Definition: control_events.h:1077
static const int FULL_SERVER_VERSION_LENGTH
Length of original and immediate server version.
Definition: control_events.h:1083
gtid_info gtid_info_struct
Definition: control_events.h:1105
static const int ENCODED_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1074
static const int IMMEDIATE_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1068
uint32_t immediate_server_version
The version of the immediate server.
Definition: control_events.h:1152
Gtid_event(const char *buf, const Format_description_event *fde)
Ctor of Gtid_event.
Definition: control_events.cpp:418
int get_commit_timestamp_length() const
Definition: control_events.h:1089
static const int64_t MIN_GNO
Definition: control_events.h:1109
static constexpr int COMMIT_GROUP_TICKET_LENGTH
Definition: control_events.h:1050
unsigned const char FLAG_MAY_HAVE_SBR
GTID flags constants.
Definition: control_events.h:991
bool has_commit_timestamps
Definition: control_events.h:998
long long int last_committed
Definition: control_events.h:988
std::uint64_t commit_group_ticket
Ticket number used to group sessions together during the BGC.
Definition: control_events.h:1155
Gtid_event(long long int last_committed_arg, long long int sequence_number_arg, bool may_have_sbr_stmts_arg, unsigned long long int original_commit_timestamp_arg, unsigned long long int immediate_commit_timestamp_arg, uint32_t original_server_version_arg, uint32_t immediate_server_version_arg)
Constructor.
Definition: control_events.h:1023
static constexpr std::uint64_t kGroupTicketUnset
Definition: control_events.h:1055
static const int IMMEDIATE_SERVER_VERSION_LENGTH
Length of immediate_server_version.
Definition: control_events.h:1081
static const int MAX_DATA_LENGTH
Definition: control_events.h:1130
static const int MAX_EVENT_LENGTH
Definition: control_events.h:1135
static const int ENCODED_FLAG_LENGTH
Definition: control_events.h:1058
Uuid Uuid_parent_struct
Definition: control_events.h:1106
unsigned long long int transaction_length
The length of the transaction in bytes.
Definition: control_events.h:1000
static const int LOGICAL_TIMESTAMP_LENGTH
Length of two logical timestamps.
Definition: control_events.h:1064
void set_trx_length(unsigned long long int transaction_length_arg)
Set the transaction length information.
Definition: control_events.h:1145
static const std::int64_t GNO_END
One-past-the-max value of GNO.
Definition: control_events.h:1111
void set_commit_group_ticket_and_update_transaction_length(std::uint64_t value)
Set the commit_group_ticket and update the transaction length if needed, that is, if the commit_group...
Definition: control_events.cpp:582
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1498
void set_log_position(uint64_t position)
Definition: control_events.cpp:745
uint64_t get_log_position() const
Definition: control_events.cpp:751
uint64_t m_log_position
Definition: control_events.h:1535
static uint64_t max_encoding_length()
This member function returns the len of the event.
Definition: control_events.cpp:758
virtual ~Heartbeat_event_v2() override=default
const std::string get_log_filename() const
Definition: control_events.cpp:748
std::string m_log_filename
Definition: control_events.h:1534
Heartbeat_event_v2()
Creates an empty heartbeat event.
Definition: control_events.cpp:739
void set_log_filename(const std::string name)
Definition: control_events.cpp:742
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1572
unsigned int ident_len
Definition: control_events.h:1592
const char * log_ident
Definition: control_events.h:1591
unsigned int get_ident_len()
Definition: control_events.h:1588
const char * get_log_ident()
Definition: control_events.h:1586
Heartbeat_event(const char *buf, const Format_description_event *fde)
Sent by a source to a replica to let the replica know that the source is still alive.
Definition: control_events.cpp:704
Base class for ignorable log events.
Definition: control_events.h:665
Ignorable_event(Log_event_type type_arg=IGNORABLE_LOG_EVENT)
The minimal constructor and all it will do is set the type_code as IGNORABLE_LOG_EVENT in the header ...
Definition: control_events.h:674
Class representing an incident, an occurrence out of the ordinary, that happened on the master.
Definition: control_events.h:431
enum_incident get_incident_type()
Definition: control_events.h:445
size_t message_length
Definition: control_events.h:483
Incident_event(enum_incident incident_arg)
This will create an Incident_event with an empty message and set the type_code as INCIDENT_EVENT in t...
Definition: control_events.h:452
enum_incident incident
Definition: control_events.h:481
char * get_message()
Definition: control_events.h:446
char * message
Definition: control_events.h:482
enum_incident
Enumeration of the incidents that can occur for the server.
Definition: control_events.h:436
@ INCIDENT_LOST_EVENTS
There are possibly lost events in the replication stream.
Definition: control_events.h:440
@ INCIDENT_COUNT
Shall be last event of the enumeration.
Definition: control_events.h:442
@ INCIDENT_NONE
No incident.
Definition: control_events.h:438
Definition: control_events.h:1208
size_t buf_size
Definition: control_events.h:1236
const unsigned char * buf
Definition: control_events.h:1237
Previous_gtids_event()
This is the minimal constructor, and set the type_code as PREVIOUS_GTIDS_LOG_EVENT in the header obje...
Definition: control_events.h:1228
When a binary log file exceeds a size limit, a ROTATE_EVENT is written at the end of the file that po...
Definition: control_events.h:107
size_t ident_len
Definition: control_events.h:110
uint64_t pos
Definition: control_events.h:112
unsigned int flags
Definition: control_events.h:111
const char * new_log_ident
Definition: control_events.h:109
~Rotate_event() override
Definition: control_events.h:162
Rotate_event(const char *new_log_ident_arg, size_t ident_len_arg, unsigned int flags_arg, uint64_t pos_arg)
This is the minimal constructor, it will set the type code as ROTATE_EVENT.
Definition: control_events.h:129
@ RELAY_LOG
Definition: control_events.h:117
@ DUP_NAME
Definition: control_events.h:116
@ R_POS_OFFSET
Definition: control_events.h:122
@ R_IDENT_OFFSET
Definition: control_events.h:123
A stop event is written to the log files under these circumstances:
Definition: control_events.h:370
Stop_event()
It is the minimal constructor, and all it will do is set the type_code as STOP_EVENT in the header ob...
Definition: control_events.h:376
This class is used to combine the information of the ongoing transaction including the write set and ...
Definition: control_events.h:1296
static const int ENCODED_SNAPSHOT_VERSION_LEN_OFFSET
Definition: control_events.h:1349
uint32_t encoded_snapshot_version_length
Definition: control_events.h:1335
static const char * read_data_set(const char *pos, uint32_t set_len, std::list< const char * > *set, uint32_t remaining_buffer)
static const int ENCODED_THREAD_ID_OFFSET
Definition: control_events.h:1345
static const int ENCODED_SERVER_UUID_LEN_OFFSET
Definition: control_events.h:1343
const unsigned char * encoded_snapshot_version
Definition: control_events.h:1334
std::list< const char * > write_set
Definition: control_events.h:1336
Transaction_context_event(unsigned int thread_id_arg, bool is_gtid_specified_arg)
Definition: control_events.h:1311
static const int ENCODED_GTID_SPECIFIED_OFFSET
Definition: control_events.h:1347
static const int ENCODED_READ_WRITE_SET_ITEM_LEN
Definition: control_events.h:1357
std::list< const char * > read_set
Definition: control_events.h:1337
const char * server_uuid
Definition: control_events.h:1331
Transaction_context_event(const char *buf, const Format_description_event *fde)
Decodes the transaction_context_log_event of the ongoing transaction.
Definition: control_events.cpp:610
static const int ENCODED_READ_SET_ITEMS_OFFSET
Definition: control_events.h:1353
static void clear_set(std::list< const char * > *set)
Function to clear the memory of the write_set and the read_set.
Definition: control_events.cpp:648
uint32_t thread_id
Definition: control_events.h:1332
bool gtid_specified
Definition: control_events.h:1333
~Transaction_context_event() override
Destructor of the Transaction_context_event class.
Definition: control_events.cpp:658
static const int ENCODED_SNAPSHOT_VERSION_LEN
Definition: control_events.h:1358
static const int ENCODED_WRITE_SET_ITEMS_OFFSET
Definition: control_events.h:1351
This event is a wrapper event and encloses many other events.
Definition: control_events.h:729
uint64_t m_uncompressed_size
The size of the data uncompressed.
Definition: control_events.h:760
const char * m_payload
The raw bytes which are the data that this event contains.
Definition: control_events.h:739
static const int MAX_DATA_LENGTH
Definition: control_events.h:770
uint64_t m_payload_size
The size of the data.
Definition: control_events.h:744
static const unsigned short COMPRESSION_TYPE_MIN_LENGTH
Definition: control_events.h:763
uint64_t get_payload_size() const
Shall get the size of the payload inside this event.
Definition: control_events.h:848
static const unsigned short UNCOMPRESSED_SIZE_MAX_LENGTH
Definition: control_events.h:768
static const unsigned short PAYLOAD_SIZE_MIN_LENGTH
Definition: control_events.h:765
void set_compression_type(transaction::compression::type type)
Shall set the compression type used for the enclosed payload.
Definition: control_events.h:823
transaction::compression::type get_compression_type() const
Shall return the compression type used for the enclosed payload.
Definition: control_events.h:832
uint64_t get_uncompressed_size() const
Shall get the uncompressed size of the event.
Definition: control_events.h:862
static const unsigned short PAYLOAD_SIZE_MAX_LENGTH
Definition: control_events.h:766
const char * get_payload() const
Shall get the payload of the event.
Definition: control_events.h:876
void set_uncompressed_size(uint64_t size)
Shall set the uncompressed size of the payload.
Definition: control_events.h:855
void set_payload(const char *data)
Shall set the payload of the event.
Definition: control_events.h:869
Transaction_payload_event & operator=(const Transaction_payload_event &)=delete
static const unsigned short COMPRESSION_TYPE_MAX_LENGTH
Definition: control_events.h:764
std::string to_string() const
Shall return a textual representation of this event.
Definition: control_events.cpp:395
void set_payload_size(uint64_t size)
Shall set the size of the payload inside this event.
Definition: control_events.h:841
transaction::compression::type m_compression_type
If the data is compressed, which compression was used.
Definition: control_events.h:753
Transaction_payload_event(const Transaction_payload_event &)=delete
static const unsigned short UNCOMPRESSED_SIZE_MIN_LENGTH
Definition: control_events.h:767
~Transaction_payload_event() override
This destroys the transaction payload event.
This class is used to add view change markers in the binary log when a member of the group enters or ...
Definition: control_events.h:1397
static const int ENCODED_CERT_INFO_KEY_SIZE_LEN
Definition: control_events.h:1446
View_change_event(const char *buf, const Format_description_event *fde)
Decodes the view_change_log_event generated in case a server enters or leaves the group.
Definition: control_events.cpp:677
static const int ENCODED_SEQ_NUMBER_OFFSET
Definition: control_events.h:1428
char view_id[ENCODED_VIEW_ID_MAX_LEN]
Definition: control_events.h:1449
static const int ENCODED_CERT_INFO_SIZE_OFFSET
Definition: control_events.h:1430
static const int ENCODED_CERT_INFO_VALUE_LEN
Definition: control_events.h:1447
static const int ENCODED_VIEW_ID_MAX_LEN
Definition: control_events.h:1445
std::map< std::string, std::string > certification_info
Definition: control_events.h:1453
static const int ENCODED_VIEW_ID_OFFSET
Definition: control_events.h:1426
long long int seq_number
Definition: control_events.h:1451
~View_change_event() override
Destructor of the View_change_event class.
Definition: control_events.cpp:702
An XA_prepare event is generated for a XA prepared transaction.
Definition: control_events.h:579
MY_XID const & get_xid() const
Retrieves the content of my_xid member variable.
Definition: control_events.cpp:352
MY_XID my_xid
Definition: control_events.h:598
void * xid
Definition: control_events.h:599
XA_prepare_event(void *xid_arg, bool oph_arg)
The minimal constructor of XA_prepare_event, it initializes the instance variable xid and set the typ...
Definition: control_events.h:608
bool one_phase
Definition: control_events.h:600
static const int MY_XIDDATASIZE
Definition: control_events.h:584
static const uint16_t ser_buf_size
Definition: control_events.h:596
bool is_one_phase() const
Whether or not this XA_prepare_event represents an XA COMMIT ONE PHASE.
Definition: control_events.cpp:350
An XID event is generated for a commit of a transaction that modifies one or more tables of an XA-cap...
Definition: control_events.h:514
uint64_t xid
Definition: control_events.h:531
Xid_event(uint64_t xid_arg)
The minimal constructor of Xid_event, it initializes the instance variable xid and set the type_code ...
Definition: control_events.h:521
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
#define ST_SERVER_VER_SPLIT_LEN
Definition: binlog_event.h:76
type
Definition: base.h:36
@ NONE
Definition: base.h:41
The namespace contains classes representing events that can occur in a replication stream.
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:274
@ XA_PREPARE_LOG_EVENT
Definition: binlog_event.h:349
@ IGNORABLE_LOG_EVENT
In some situations, it is necessary to send over ignorable data to the slave: data that a slave can h...
Definition: binlog_event.h:331
@ PREVIOUS_GTIDS_LOG_EVENT
Definition: binlog_event.h:342
@ TRANSACTION_CONTEXT_EVENT
Definition: binlog_event.h:344
@ INCIDENT_EVENT
Something out of the ordinary happened on the master.
Definition: binlog_event.h:317
@ GTID_LOG_EVENT
Definition: binlog_event.h:339
@ ROTATE_EVENT
Definition: binlog_event.h:290
@ XID_EVENT
Definition: binlog_event.h:301
@ STOP_EVENT
Definition: binlog_event.h:289
Definition: buf0block_hint.cc:29
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2880
required string type
Definition: replication_group_member_actions.proto:33
case opt name
Definition: sslopt-case.h:32
This is a POD.
Definition: uuid.h:60
Definition: control_events.h:587
long gtrid_length
Definition: control_events.h:589
long bqual_length
Definition: control_events.h:590
char data[MY_XIDDATASIZE]
Definition: control_events.h:591
long formatID
Definition: control_events.h:588
Structure to hold the members declared in the class Gtid_log_event those member are objects of classe...
Definition: control_events.h:717
int64_t rpl_gtid_gno
Definition: control_events.h:719
int32_t rpl_gtid_sidno
Definition: control_events.h:718
Include file for Sun RPC to compile out of the box.
void bapi_free(void *ptr)
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent lib...
Definition: wrapper_functions.h:189