Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a0d4f0f3
Commit
a0d4f0f3
authored
May 18, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.2' into 10.3
commit
84984b79
is null-merged
parents
d388e7eb
84984b79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
2 deletions
+121
-2
mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result
mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result
+46
-0
mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test
mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test
+72
-0
sql/slave.cc
sql/slave.cc
+3
-2
No files found.
mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result
0 → 100644
View file @
a0d4f0f3
include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
#
# Initialize test data
connection master;
create table t1 (a int);
SET @@session.server_id= 3;
create table t2 (a int);
include/save_master_gtid.inc
#
# Have the replica "reconnect" and the primary will send Gtid, Glle, DDL
connection slave;
set global gtid_slave_pos="0-3-1";
include/start_slave.inc
include/sync_with_master_gtid.inc
#
# Ensure that the replica did not error
connection slave;
include/sync_with_master_gtid.inc
Last_SQL_Error =
Last_SQL_Errno = 0
#
# Ensure that the primary sent a Glle after a Gtid event
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
slave-relay-bin.000002 # Gtid_list # # []
slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
slave-relay-bin.000002 # Gtid # # GTID #-#-#
slave-relay-bin.000002 # Gtid_list # # [#-#-#]
slave-relay-bin.000002 # Query # # use `test`; create table t2 (a int)
#
# Ensure the DDL was executed on the replica
#
# Cleanup
# t1 does not make it to the replica
connection master;
set sql_log_bin=0;
DROP TABLE t1;
set sql_log_bin=1;
DROP TABLE t2;
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test
0 → 100644
View file @
a0d4f0f3
#
# Purpose:
# If a fake Glle event follows a Gtid event, we need to ensure the rest of
# the group should not terminate at the Glle event. MDEV-28550 revealed that
# a Glle would terminate the event and upon reconnect, the DDL would be lost.
#
# Methodology:
# Force the primary to send a fake GLLE event after a GTID on a "reconnect"
# and ensure that both 1) the replica does not error, and 2) the original
# command within the GTID is executed.
#
# References:
# MDEV-28550: improper handling of replication event group that contains Gtid_log_list_event
--
source
include
/
master
-
slave
.
inc
# Independent of binlog format
--
source
include
/
have_binlog_format_statement
.
inc
--
connection
slave
--
source
include
/
stop_slave
.
inc
CHANGE
MASTER
TO
MASTER_USE_GTID
=
slave_pos
;
--
echo
#
--
echo
# Initialize test data
--
connection
master
create
table
t1
(
a
int
);
SET
@@
session
.
server_id
=
3
;
create
table
t2
(
a
int
);
--
source
include
/
save_master_gtid
.
inc
--
echo
#
--
echo
# Have the replica "reconnect" and the primary will send Gtid, Glle, DDL
--
connection
slave
eval
set
global
gtid_slave_pos
=
"0-3-1"
;
--
source
include
/
start_slave
.
inc
--
source
include
/
sync_with_master_gtid
.
inc
--
echo
#
--
echo
# Ensure that the replica did not error
connection
slave
;
--
source
include
/
sync_with_master_gtid
.
inc
let
$error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Error
,
1
);
--
echo
Last_SQL_Error
=
$error
let
$errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Errno
,
1
);
--
echo
Last_SQL_Errno
=
$errno
--
echo
#
--
echo
# Ensure that the primary sent a Glle after a Gtid event
let
$binlog_file
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Relay_Log_File
,
1
);
let
$binlog_start
=
$relaylog_start
;
let
$binlog_limit
=
0
,
10
;
--
source
include
/
show_relaylog_events
.
inc
--
echo
#
--
echo
# Ensure the DDL was executed on the replica
if
(
!
`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`
)
{
die
"t2 should exist on slave"
;
}
--
echo
#
--
echo
# Cleanup
--
echo
# t1 does not make it to the replica
--
connection
master
set
sql_log_bin
=
0
;
DROP
TABLE
t1
;
set
sql_log_bin
=
1
;
DROP
TABLE
t2
;
--
source
include
/
rpl_end
.
inc
sql/slave.cc
View file @
a0d4f0f3
...
...
@@ -7003,8 +7003,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment