File: rpl_sync_relay_log_info.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 (102 lines) | stat: -rw-r--r-- 4,947 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# ==== Purpose ====
#
# This test case will verify the behavior of the SQL thread writing the relay
# log info into the mysql.slave_relay_log_info system table.
#
# It will run a set of sub-tests varying the storage engine used in the
# replicated statements (transactional (InnoDB) and non-transactional (MyISAM),
# and also varying the sync_relay_log_info global variable between 1 (sync for
# every transaction) an 0 (never sync).
#
# The expected behavior for the update of the relay log positions in the
# include file sourced by this test case are defined by a string containing
# sequences of two possible letters:
#   "N": No update to the relay log info is expected;
#   "U": The update to the relay log info is expected;
#
# The sub tests are divided into 25 steps (18 for non-transactional tables).
#
# Below is a list of the steps and the expected behavior for each tested
# configuration:
#
# We used MyISAM for non-transactional (NT) and InnoDB for transactional (T)
# storage engines.
#
# WL9175 changed some of original signatures related to DDL on transactional SE.
# Regardless of sync_relay_log_info value the relay log info gets U-pdated
# as a part of the DDL transaction.
#
#                                    sync_relay_log_info=  0   1   0   1
#                                         storage engine=  NT  NT  T   T
#                                                         --- --- --- ---
# 1 - Stop/Start the slave ----------------------------->  U   U   U   U
# 2 - Simple DDL - CREATE TABLE ------------------------>  N   U   U   U
# 3 - Simple DML - INSERT ------------------------------>  N   U   U   U
# 4 - Master flushed the binary log -------------------->  U   U   U   U
# 5 - Simple DDL - DROP TABLE -------------------------->  N   U   U   U
# 6 - Stop/Start the slave ----------------------------->  U   U   U   U
# 7 - The GTID of a simple DDL ------------------------->  N   N   N   N
# 8 - Flushed the relay log in the middle of the DDL --->  N   N   N   N
# 9 - The rest of the simple DDL ----------------------->  U   U   U   U
# 10 - Stop/Start the slave ---------------------------->  U   U   U   U
# 11 - The GTID of a simple DML ------------------------>  N   N   N   N
# 12 - Flushed the relay log after the GTID of the DML ->  N   N   N   N
# 13 - The rest of the simple DML ---------------------->  U   U   U   U
# 14 - Stop/Start the slave ---------------------------->  U   U   U   U
# 15 - The first part of a simple DML up to a User var ->  N   N   N   N
# 16 - Flushed the relay log in the middle of the DML -->  N   N   N   N
# 17 - The rest of the simple DML ---------------------->  U   U   U   U
# 18 - Simple DDL -------------------------------------->  N   U   U   U
#   Transactional tables only:
# 19 - Simple DDL - CREATE TABLE -----------------------> N/A N/A  U   U
# 20 - Stop/Start the slave ----------------------------> N/A N/A  U   U
# 21 - The first half of a multi statement DML ---------> N/A N/A  N   N
# 22 - Flushed the relay log in the middle of the DML --> N/A N/A  N   N
# 23 - The multi statement DML should be rolled back ---> N/A N/A  N   N
# 24 - The retry of the multi statement DML ------------> N/A N/A  U   U
# 25 - Simple DDL - DROP TABLE -------------------------> N/A N/A  U   U
#
# ==== Related Bugs and Worklogs ====
#
# BUG#20451386 SQL THREAD CRASH: LOG-REPLICA-UPDATES OFF, RELAY LOG ENDS WITH
#              GTID_LOG_EVENT

# This test should run only on debug build
--source include/have_debug.inc
# This test uses debug sync to stop the IO thread in the middle of a transaction
--source include/have_debug_sync.inc
# Test requires relay-log-info-repository = TABLE
--source include/not_relay_log_info_file.inc
--source include/have_binlog_format_statement.inc
--let $rpl_gtid_utils= 1
--source include/master-slave.inc

# Known errors that will be logged
CALL mtr.add_suppression('Duplicate entry');
--let $master_uuid=`SELECT @@GLOBAL.server_uuid`

# Save global variables that will be changed during the test
--source include/rpl_connection_slave.inc
CALL mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
SET @saved_sync_relay_log_info= @@GLOBAL.sync_relay_log_info;

--echo #
--echo # sync_relay_log_info= 0, transactional (InnoDB) storage engine
--echo #
SET @@GLOBAL.sync_relay_log_info= 0;
--let $storage_engine= InnoDB
--let $rpl_relay_log_info_expected_update= UUUUUUNNUUNNUUNNUUUUNNNUU
--source extra/rpl_tests/rpl_sync_relay_log_info.inc

--echo #
--echo # sync_relay_log_info= 1, transactional (InnoDB) storage engine
--echo #
SET @@GLOBAL.sync_relay_log_info= 1;
--let $storage_engine= InnoDB
--let $rpl_relay_log_info_expected_update= UUUUUUNNUUNNUUNNUUUUNNNUU
--source extra/rpl_tests/rpl_sync_relay_log_info.inc

# Cleanup
--source include/rpl_connection_slave.inc
SET @@GLOBAL.sync_relay_log_info= @saved_sync_relay_log_info;
--source include/rpl_end.inc