Debian Codegraph @

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

raw
1 #
2 # The test verifies expected behaviour when
3 # the slave retries events starting from group internal position.
4 # Their execution in Logical_Clock mode is allowed.
5 # See bug#19473291.
6 # Notice that old master events are viewed effectively as
7 # malformed group events. Therefore this test applies to cross-version replication
8 # as well.
9 #
10 # GTIDs are expected in binlog when events are indexed by query_get_value below
11 --source include/have_binlog_format_mixed.inc
12 --source include/master-slave.inc
13
14 # Logic of the test is as the following.
15 # Configure MTS with few workers and LOGICAL_CLOCK scheduler.
16 # Replicate some events.
17 # Stop slave threads to reconfigure retrival from an already read, executed and
18 # group internal position (COMMIT/Xid event position is chosen to avoid
19 # a GTID specific error).
20 # Restart slave threads and observe the SQL applier has processed events.
21
22 --source include/rpl_connection_slave.inc
23 call mtr.add_suppression("Either event.*is from an old source");
24 # The transaction boundary parser will log the following two warning messages:
25 call mtr.add_suppression("An unexpected event sequence was detected by the IO thread");
26 call mtr.add_suppression("QUERY.* is not expected in an event stream");
27
28 --source include/stop_slave.inc
29
30 SET @save_replica_parallel_type = @@GLOBAL.replica_parallel_type;
31 SET @save_replica_parallel_workers = @@GLOBAL.replica_parallel_workers;
32 SET @save_replica_transaction_retries = @@GLOBAL.replica_transaction_retries;
33
34 SET GLOBAL replica_parallel_type = LOGICAL_CLOCK;
35 SET GLOBAL replica_parallel_workers = 2;
36 SET GLOBAL replica_transaction_retries = 0;
37 --source include/start_slave.inc
38
39 --source include/rpl_connection_master.inc
40 CREATE TABLE t1(a INT);
41 INSERT INTO t1 SET a=1;
42 --let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
43 --let $logged_query= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM 4, Info, 7)
44 --let $query_pos= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM 4, End_log_pos,7)
45
46 --source include/sync_slave_sql_with_master.inc
47 --source include/stop_slave.inc
48 --replace_result $query_pos QUERY_POS
49 --eval CHANGE REPLICATION SOURCE TO SOURCE_LOG_POS=$query_pos, SOURCE_AUTO_POSITION=0
50 --source include/start_slave_io.inc
51 START SLAVE SQL_THREAD;
52
53 #
54 # Cleanup
55 #
56 --source include/rpl_connection_master.inc
57 DROP TABLE t1;
58
59 --source include/sync_slave_sql_with_master.inc
60 --source include/stop_slave.inc
61 --disable_warnings
62 SET GLOBAL replica_parallel_workers = @save_replica_parallel_workers;
63 --enable_warnings
64 SET GLOBAL replica_parallel_type = @save_replica_parallel_type;
65 SET GLOBAL replica_transaction_retries = @save_replica_transaction_retries;
66 --source include/start_slave.inc
67
68 --source include/rpl_end.inc