Commit 726bd8c9 authored by Andrei's avatar Andrei Committed by Sergei Golubchik

MDEV-28550 improper handling of replication event group that contains

GTID_LIST_EVENT or INCIDENT_EVENT.

It's legal to have either of the two inside a group. E.g
  Gtid_event, Gtid_log_list_event, Query_1, ... Xid_log_event
is permitted.
However, the slave IO thread treated both
as the terminal even when the group represents a DDL query.
That causes a premature Gtid state update so the slave IO would think
the whole group has been collected while in fact Query_1 etc are yet to process.

Fixed with correcting a condition to compute the terminal event
of the group.
Tested with rpl_mysqlbinlog_slave_consistency (of 10.9) and
rpl_gtid_errorlog.test.
parent a5dc12ee
...@@ -6586,8 +6586,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) ...@@ -6586,8 +6586,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
mi->using_gtid != Master_info::USE_GTID_NO && mi->using_gtid != Master_info::USE_GTID_NO &&
mi->events_queued_since_last_gtid > 0 && mi->events_queued_since_last_gtid > 0 &&
( (mi->last_queued_gtid_standalone && ( (mi->last_queued_gtid_standalone &&
!Log_event::is_part_of_group((Log_event_type)(uchar) (LOG_EVENT_IS_QUERY((Log_event_type)(uchar)
buf[EVENT_TYPE_OFFSET])) || buf[EVENT_TYPE_OFFSET]) ||
(uchar)buf[EVENT_TYPE_OFFSET] == INCIDENT_EVENT)) ||
(!mi->last_queued_gtid_standalone && (!mi->last_queued_gtid_standalone &&
((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT || ((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT ||
((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment