summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorAndrei <andrei.elkin@mariadb.com>2022-05-12 19:24:26 +0300
committerSergei Golubchik <serg@mariadb.org>2022-05-13 09:45:32 +0200
commit726bd8c968e1b60a72f2a798a8fc269b78239cdc (patch)
tree58f4f7c6becc57e690cb68bb1f75843de5d0ea92 /sql/slave.cc
parenta5dc12eefd4bea1c3f77d02c55d0d459b4ae0566 (diff)
downloadmariadb-git-726bd8c968e1b60a72f2a798a8fc269b78239cdc.tar.gz
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.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index ca3397e5e7b..ac9addee7a4 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -6586,8 +6586,9 @@ dbug_gtid_accept:
mi->using_gtid != Master_info::USE_GTID_NO &&
mi->events_queued_since_last_gtid > 0 &&
( (mi->last_queued_gtid_standalone &&
- !Log_event::is_part_of_group((Log_event_type)(uchar)
- buf[EVENT_TYPE_OFFSET])) ||
+ (LOG_EVENT_IS_QUERY((Log_event_type)(uchar)
+ buf[EVENT_TYPE_OFFSET]) ||
+ (uchar)buf[EVENT_TYPE_OFFSET] == INCIDENT_EVENT)) ||
(!mi->last_queued_gtid_standalone &&
((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT ||
((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */