Debian Codegraph @

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

raw
1 #
2 # ==== Purpose ====
3 #
4 # This test ensures that a fully retrieved transaction will not be asked to be
5 # retrieved again by the IO thread.
6 #
7 # The test first creates a transactional table and add some data on it. Then,
8 # it issues a "RESET MASTER" on the slave to make the slave to clean its
9 # GTID_EXECUTED, but the Retrieved_Gtid_Set is kept untouched.
10 # A restart in the IO thread with this situation should not make the IO thread
11 # to retrieve the last received transaction again. The test case test this by
12 # verifying the table consistency after syncing the slave SQL thread.
13 #
14 #
15 # ==== Related Bugs and Worklogs ====
16 #
17 # BUG#17943188: SHOW SLAVE STATUS/RETRIEVED_GTID_SET MAY HAVE PARTIAL TRX OR
18 # MISS COMPLETE TRX
19 # BUG#18629623: INCONSISTENT DATA IN GTID (RESET MASTER, STOP SLAVE, START
20 # SLAVE)
21 #
22 --source include/not_group_replication_plugin.inc
23 --source include/master-slave.inc
24
25 # Get the master UUID to filter displayed data
26 --let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`
27
28 #
29 # First part
30 #
31
32 # Put some data into master, finishing with a DML
33 CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
34 INSERT INTO t1 VALUES (1);
35
36 # Sync slave with master
37 --source include/sync_slave_sql_with_master.inc
38
39 # Clean GTIDs on slave, so if a already retrieved transaction be asked
40 # again to the master, the transaction will be applied again, generating
41 # data inconsistency.
42 RESET MASTER;
43
44 # Restart the slave threads
45 --source include/stop_slave.inc
46 --source include/start_slave.inc
47
48 # Make sure the SQL thread is synced before checking consistency
49 --source include/rpl_connection_master.inc
50 --let $ignore_gtids_on_sync= 1
51 --source include/sync_slave_sql_with_master.inc
52
53 # Check t1 consistency
54 --source include/rpl_connection_master.inc
55 --let $diff_tables= master:t1, slave:t1
56 --source include/diff_tables.inc
57
58 #
59 # Cleanup
60 #
61
62 # Save slave Retrieved_Gtid_Set to add it as slave's GTID_PURGED
63 --source include/rpl_connection_slave.inc
64 --let $slave_gtid_purged= query_get_value(SHOW SLAVE STATUS, Retrieved_Gtid_Set, 1)
65 RESET MASTER;
66 --replace_result $master_uuid MASTER_UUID
67 --eval SET @@GLOBAL.GTID_PURGED='$slave_gtid_purged'
68
69 --source include/rpl_connection_master.inc
70 DROP TABLE t1;
71 --source include/rpl_end.inc