mirror of
https://github.com/MariaDB/server.git
synced 2025-07-02 14:22:51 +03:00
Merge branch bb-10.2-release into bb-10.3-release
This commit is contained in:
@ -32,6 +32,7 @@
|
||||
#include "semisync_master.h"
|
||||
#include "semisync_slave.h"
|
||||
|
||||
|
||||
enum enum_gtid_until_state {
|
||||
GTID_UNTIL_NOT_DONE,
|
||||
GTID_UNTIL_STOP_AFTER_STANDALONE,
|
||||
@ -813,7 +814,7 @@ get_slave_until_gtid(THD *thd, String *out_str)
|
||||
@param event_coordinates binlog file name and position of the last
|
||||
real event master sent from binlog
|
||||
|
||||
@note
|
||||
@note
|
||||
Among three essential pieces of heartbeat data Log_event::when
|
||||
is computed locally.
|
||||
The error to send is serious and should force terminating
|
||||
@ -827,6 +828,8 @@ static int send_heartbeat_event(binlog_send_info *info,
|
||||
DBUG_ENTER("send_heartbeat_event");
|
||||
|
||||
ulong ev_offset;
|
||||
char sub_header_buf[HB_SUB_HEADER_LEN];
|
||||
bool sub_header_in_use=false;
|
||||
if (reset_transmit_packet(info, info->flags, &ev_offset, &info->errmsg))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
@ -847,18 +850,38 @@ static int send_heartbeat_event(binlog_send_info *info,
|
||||
size_t event_len = ident_len + LOG_EVENT_HEADER_LEN +
|
||||
(do_checksum ? BINLOG_CHECKSUM_LEN : 0);
|
||||
int4store(header + SERVER_ID_OFFSET, global_system_variables.server_id);
|
||||
DBUG_EXECUTE_IF("simulate_pos_4G",
|
||||
{
|
||||
const_cast<event_coordinates *>(coord)->pos= (UINT_MAX32 + (ulong)1);
|
||||
DBUG_SET("-d, simulate_pos_4G");
|
||||
};);
|
||||
if (coord->pos <= UINT_MAX32)
|
||||
{
|
||||
int4store(header + LOG_POS_OFFSET, coord->pos); // log_pos
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set common_header.log_pos=0 to indicate its overflow
|
||||
int4store(header + LOG_POS_OFFSET, 0);
|
||||
sub_header_in_use= true;
|
||||
int8store(sub_header_buf, coord->pos);
|
||||
event_len+= HB_SUB_HEADER_LEN;
|
||||
}
|
||||
|
||||
int4store(header + EVENT_LEN_OFFSET, event_len);
|
||||
int2store(header + FLAGS_OFFSET, 0);
|
||||
|
||||
int4store(header + LOG_POS_OFFSET, coord->pos); // log_pos
|
||||
|
||||
packet->append(header, sizeof(header));
|
||||
packet->append(p, ident_len); // log_file_name
|
||||
if (sub_header_in_use)
|
||||
packet->append(sub_header_buf, sizeof(sub_header_buf));
|
||||
packet->append(p, ident_len); // log_file_name
|
||||
|
||||
if (do_checksum)
|
||||
{
|
||||
char b[BINLOG_CHECKSUM_LEN];
|
||||
ha_checksum crc= my_checksum(0, (uchar*) header, sizeof(header));
|
||||
if (sub_header_in_use)
|
||||
crc= my_checksum(crc, (uchar*) sub_header_buf, sizeof(sub_header_buf));
|
||||
crc= my_checksum(crc, (uchar*) p, ident_len);
|
||||
int4store(b, crc);
|
||||
packet->append(b, sizeof(b));
|
||||
|
Reference in New Issue
Block a user