Debian Codegraph @

mysql-test/suite/rpl/t/rpl_crc_check.test

raw
1 # ==== Purpose ====
2 #
3 # Bug #20644100 "Event crc check failed" when master disable binlog_checksum
4 #
5 # Starting slave sql_thread to apply events will cause event crc check
6 # failure when master disables binlog_checksum.
7 #
8 # Currently relay logs have the following sequence (starting from
9 # position 4):
10 # Format_desc (of slave)
11 # Previous-GTIDs (of slave, if GTIDs are enabled)
12 # Rotate (of master)
13 # Format_desc (of master)
14 # The Format_desc which really describes the rest of the relay
15 # log is the 4rd event, which is from master.
16 # Relay_log_info::init_relay_log_pos(...) will look for a
17 # Format_description_log_event from master. We only need this when
18 # slave applier thread starts and opens an existing relay log and
19 # has to execute it (possibly from an offset >4), because we need
20 # to read the description event of the relay log to be able to
21 # parse the events we have to execute.
22 # But the current code supposed that relay logs have the following
23 # sequence (starting from position 4):
24 # Format_desc (of slave)
25 # Rotate (of master)
26 # Format_desc (of master)
27 # So the function failed to find the Format_description_log_event
28 # from master when slave applier thread starts and opens an existing
29 # relay log and has to execute it, which causes some failures.
30 # The event crc check failure is one of them.
31 #
32 # Fix code to let slave applier thread also skip the Previous-GTIDs
33 # log event to find the correct Format_description_log_event from
34 # master when it is starting and opening an existing relay log.
35 #
36 # Steps to reproduce:
37 # 1) Start master and slave servers
38 # 2) Stop slave applier thread.
39 # 3) Write an event into binary log on master
40 # when master disables binlog_checksum.
41 # 4) Start slave applier thread to verify that
42 # their is no event crc check failure.
43 #
44
45 --source include/not_group_replication_plugin.inc
46 # Test in this file is binlog format agnostic, thus no need
47 # to rerun them for every format.
48 --source include/have_binlog_format_row.inc
49 --source include/master-slave.inc
50
51 --source include/rpl_connection_slave.inc
52 --source include/stop_slave_sql.inc
53
54 --source include/rpl_connection_master.inc
55 CREATE TABLE t1 (c1 INT);
56
57 --echo #
58 --echo # Start slave applier thread to verify that
59 --echo # their is no event crc check failure.
60 --echo #
61 --source include/rpl_connection_slave.inc
62 --source include/start_slave_sql.inc
63
64 --source include/rpl_connection_master.inc
65 DROP TABLE t1;
66
67 --source include/rpl_end.inc