Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_sync_relay_log_info.test

raw
1 # ==== Purpose ====
2 #
3 # This test case will verify the behavior of the SQL thread writing the relay
4 # log info into the mysql.slave_relay_log_info system table.
5 #
6 # It will run a set of sub-tests varying the storage engine used in the
7 # replicated statements (transactional (InnoDB) and non-transactional (MyISAM),
8 # and also varying the sync_relay_log_info global variable between 1 (sync for
9 # every transaction) an 0 (never sync).
10 #
11 # The expected behavior for the update of the relay log positions in the
12 # include file sourced by this test case are defined by a string containing
13 # sequences of two possible letters:
14 # "N": No update to the relay log info is expected;
15 # "U": The update to the relay log info is expected;
16 #
17 # The sub tests are divided into 25 steps (18 for non-transactional tables).
18 #
19 # Below is a list of the steps and the expected behavior for each tested
20 # configuration:
21 #
22 # We used MyISAM for non-transactional (NT) and InnoDB for transactional (T)
23 # storage engines.
24 #
25 # WL9175 changed some of original signatures related to DDL on transactional SE.
26 # Regardless of sync_relay_log_info value the relay log info gets U-pdated
27 # as a part of the DDL transaction.
28 #
29 # sync_relay_log_info= 0 1 0 1
30 # storage engine= NT NT T T
31 # --- --- --- ---
32 # 1 - Stop/Start the slave -----------------------------> U U U U
33 # 2 - Simple DDL - CREATE TABLE ------------------------> N U U U
34 # 3 - Simple DML - INSERT ------------------------------> N U U U
35 # 4 - Master flushed the binary log --------------------> U U U U
36 # 5 - Simple DDL - DROP TABLE --------------------------> N U U U
37 # 6 - Stop/Start the slave -----------------------------> U U U U
38 # 7 - The GTID of a simple DDL -------------------------> N N N N
39 # 8 - Flushed the relay log in the middle of the DDL ---> N N N N
40 # 9 - The rest of the simple DDL -----------------------> U U U U
41 # 10 - Stop/Start the slave ----------------------------> U U U U
42 # 11 - The GTID of a simple DML ------------------------> N N N N
43 # 12 - Flushed the relay log after the GTID of the DML -> N N N N
44 # 13 - The rest of the simple DML ----------------------> U U U U
45 # 14 - Stop/Start the slave ----------------------------> U U U U
46 # 15 - The first part of a simple DML up to a User var -> N N N N
47 # 16 - Flushed the relay log in the middle of the DML --> N N N N
48 # 17 - The rest of the simple DML ----------------------> U U U U
49 # 18 - Simple DDL --------------------------------------> N U U U
50 # Transactional tables only:
51 # 19 - Simple DDL - CREATE TABLE -----------------------> N/A N/A U U
52 # 20 - Stop/Start the slave ----------------------------> N/A N/A U U
53 # 21 - The first half of a multi statement DML ---------> N/A N/A N N
54 # 22 - Flushed the relay log in the middle of the DML --> N/A N/A N N
55 # 23 - The multi statement DML should be rolled back ---> N/A N/A N N
56 # 24 - The retry of the multi statement DML ------------> N/A N/A U U
57 # 25 - Simple DDL - DROP TABLE -------------------------> N/A N/A U U
58 #
59 # ==== Related Bugs and Worklogs ====
60 #
61 # BUG#20451386 SQL THREAD CRASH: LOG-REPLICA-UPDATES OFF, RELAY LOG ENDS WITH
62 # GTID_LOG_EVENT
63
64 # This test should run only on debug build
65 --source include/have_debug.inc
66 # This test uses debug sync to stop the IO thread in the middle of a transaction
67 --source include/have_debug_sync.inc
68 # Test requires relay-log-info-repository = TABLE
69 --source include/not_relay_log_info_file.inc
70 --source include/have_binlog_format_statement.inc
71 --let $rpl_gtid_utils= 1
72 --source include/master-slave.inc
73
74 # Known errors that will be logged
75 CALL mtr.add_suppression('Duplicate entry');
76 --let $master_uuid=`SELECT @@GLOBAL.server_uuid`
77
78 # Save global variables that will be changed during the test
79 --source include/rpl_connection_slave.inc
80 CALL mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
81 SET @saved_sync_relay_log_info= @@GLOBAL.sync_relay_log_info;
82
83 --echo #
84 --echo # sync_relay_log_info= 0, transactional (InnoDB) storage engine
85 --echo #
86 SET @@GLOBAL.sync_relay_log_info= 0;
87 --let $storage_engine= InnoDB
88 --let $rpl_relay_log_info_expected_update= UUUUUUNNUUNNUUNNUUUUNNNUU
89 --source extra/rpl_tests/rpl_sync_relay_log_info.inc
90
91 --echo #
92 --echo # sync_relay_log_info= 1, transactional (InnoDB) storage engine
93 --echo #
94 SET @@GLOBAL.sync_relay_log_info= 1;
95 --let $storage_engine= InnoDB
96 --let $rpl_relay_log_info_expected_update= UUUUUUNNUUNNUUNNUUUUNNNUU
97 --source extra/rpl_tests/rpl_sync_relay_log_info.inc
98
99 # Cleanup
100 --source include/rpl_connection_slave.inc
101 SET @@GLOBAL.sync_relay_log_info= @saved_sync_relay_log_info;
102 --source include/rpl_end.inc