Debian Codegraph @

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

raw
1 # ==== Purpose ====
2 #
3 # Test verifies that forced sync master info doesn't happen on a
4 # heartbeat/fakerotate event.
5 #
6 # ==== Implementation ====
7 #
8 # Generate some transactions on master so that they are replicated and applied
9 # on slave. This will ensure that GITD_EXECUTED set is updated on slave.
10 #
11 # Stop and restart the slave. Receiver thread will invoke 'com_binlog_dump_gtid'
12 # function call which provides existing GTID specific information on slave to
13 # master.
14 #
15 # Master will skip all the GTID events that are present on slave and will
16 # generate a HEARTBEAT event which contains the master_log_file and
17 # master_log_pos at which the skipped events end.
18 #
19 # Upon receiving the HEARTBEAT event store the write requests that are made to
20 # 'slave_master_info' table, in a variable. This value is used to verify the
21 # write request to 'slave_master_info' after the HEARTBEAT event is processed.
22 #
23 # Apply the HEARTBEAT event and verify that no additional write request is
24 # made during HEARTBEAT event processing.
25 #
26 # ==== References ====
27 #
28 # Bug#28815555: HEARTBEATS/FAKEROTATE CAUSE A FORCED SYNC_SOURCE_INFO
29 #
30
31 # Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE
32 --source include/have_slave_repository_type_table.inc
33 --source include/have_debug.inc
34 --source include/have_debug_sync.inc
35 --source include/master-slave.inc
36
37 --source include/rpl_connection_slave.inc
38 # Enable performance schema monitoring for mysql schema
39 --source include/stop_slave.inc
40 UPDATE performance_schema.setup_objects SET ENABLED='yes', TIMED='yes' WHERE OBJECT_SCHEMA='mysql';
41 --source include/start_slave.inc
42
43 --source include/rpl_connection_master.inc
44 CREATE TABLE t1 (f INT PRIMARY KEY) ENGINE=InnoDB;
45 INSERT INTO t1 VALUES (10);
46 INSERT INTO t1 VALUES (20);
47 INSERT INTO t1 VALUES (30);
48 --source include/sync_slave_sql_with_master.inc
49
50 --source include/stop_slave.inc
51 SET GLOBAL debug="+d,reached_heart_beat_queue_event";
52 START SLAVE;
53 SET DEBUG_SYNC="now WAIT_FOR check_replica_source_info";
54 let $sync_source_info_before= query_get_value(SELECT count_star FROM performance_schema.table_io_waits_summary_by_table WHERE OBJECT_SCHEMA='mysql' AND OBJECT_NAME ='slave_master_info', count_star, 1);
55 SET DEBUG_SYNC="now SIGNAL proceed_write_rotate";
56 SET GLOBAL debug="-d,reached_heart_beat_queue_event";
57
58 --source include/rpl_connection_master.inc
59 --source include/sync_slave_sql_with_master.inc
60
61 let $sync_source_info_after= query_get_value(SELECT count_star FROM performance_schema.table_io_waits_summary_by_table WHERE OBJECT_SCHEMA='mysql' AND OBJECT_NAME ='slave_master_info', count_star, 1);
62
63 --let $assert_text= Assert that sync_source_info io_requests are the same
64 --let $assert_cond= $sync_source_info_before = $sync_source_info_after
65 --source include/assert.inc
66
67 --let $diff_tables=master:t1, slave:t1
68 --source include/diff_tables.inc
69
70 # Clean up
71 --source include/stop_slave.inc
72 UPDATE performance_schema.setup_objects SET ENABLED='no', TIMED='no' WHERE OBJECT_SCHEMA='mysql';
73 --source include/start_slave.inc
74
75 --source include/rpl_connection_master.inc
76 DROP TABLE t1;
77
78 --source include/rpl_end.inc