File: rpl_crc_check.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (67 lines) | stat: -rw-r--r-- 2,444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ==== Purpose ====
#
# Bug #20644100  "Event crc check failed" when master disable binlog_checksum
#
# Starting slave sql_thread to apply events will cause event crc check
# failure when master disables binlog_checksum.
#
# Currently relay logs have the following sequence (starting from
# position 4):
# Format_desc (of slave)
# Previous-GTIDs (of slave, if GTIDs are enabled)
# Rotate (of master)
# Format_desc (of master)
# The Format_desc which really describes the rest of the relay
# log is the 4rd event, which is from master.
# Relay_log_info::init_relay_log_pos(...) will look for a
# Format_description_log_event from master. We only need this when
# slave applier thread starts and opens an existing relay log and
# has to execute it (possibly from an offset >4), because we need
# to read the description event of the relay log to be able to
# parse the events we have to execute.
# But the current code supposed that relay logs have the following
# sequence (starting from position 4):
# Format_desc (of slave)
# Rotate (of master)
# Format_desc (of master)
# So the function failed to find the Format_description_log_event
# from master when slave applier thread starts and opens an existing
# relay log and has to execute it, which causes some failures.
# The event crc check failure is one of them.
#
# Fix code to let slave applier thread also skip the Previous-GTIDs
# log event to find the correct Format_description_log_event from
# master when it is starting and opening an existing relay log.
#
# Steps to reproduce:
# 1) Start master and slave servers
# 2) Stop slave applier thread.
# 3) Write an event into binary log on master
#    when master disables binlog_checksum.
# 4) Start slave applier thread to verify that
#    their is no event crc check failure.
#

--source include/not_group_replication_plugin.inc
# Test in this file is binlog format agnostic, thus no need
# to rerun them for every format.
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

--source include/rpl_connection_slave.inc
--source include/stop_slave_sql.inc

--source include/rpl_connection_master.inc
CREATE TABLE t1 (c1 INT);

--echo #
--echo # Start slave applier thread to verify that
--echo # their is no event crc check failure.
--echo #
--source include/rpl_connection_slave.inc
--source include/start_slave_sql.inc

--source include/rpl_connection_master.inc
DROP TABLE t1;

--source include/rpl_end.inc