Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_gtid_retrieve_last_trx_myisam.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 first part of the test repeats the above procedure making the last
8 # transaction to be retrieved by IO thread to be a DDL (without XID or
9 # QUERY(COMMIT) events to mark its end).
10 #
11 # The second part of the test repeats the first part procedure by inserting
12 # data into a non-transactional table.
13 #
14 # ==== Related Bugs and Worklogs ====
15 #
16 # BUG#17943188: SHOW SLAVE STATUS/RETRIEVED_GTID_SET MAY HAVE PARTIAL TRX OR
17 # MISS COMPLETE TRX
18 # BUG#18629623: INCONSISTENT DATA IN GTID (RESET MASTER, STOP SLAVE, START
19 # SLAVE)
20 #
21 --source include/not_group_replication_plugin.inc
22 --source include/force_myisam_default.inc
23 --source include/have_myisam.inc
24
25 --source include/master-slave.inc
26
27 # Get the master UUID to filter displayed data
28 --let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`
29
30 #
31 # First part
32 #
33
34 # Now finishing with a DDL (no XID or QUERY(COMMIT) at the end of trx)
35 CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
36
37 # Sync slave with master
38 --source include/sync_slave_sql_with_master.inc
39
40 # Clean GTIDs on slave, so if a already retrieved transaction be asked
41 # again to the master, the transaction will be applied again, generating
42 # data inconsistency.
43 RESET MASTER;
44
45 # Restart the slave threads
46 --source include/stop_slave.inc
47 --source include/start_slave.inc
48
49 # Make sure the SQL thread is synced without errors
50 --source include/rpl_connection_master.inc
51 --let $ignore_gtids_on_sync= 1
52 --source include/sync_slave_sql_with_master.inc
53
54 # Put some data into master into a non-trx table, finishing with a DML
55 --source include/rpl_connection_master.inc
56 INSERT INTO t2 VALUES (1);
57
58 # Sync slave with master
59 --let $ignore_gtids_on_sync= 1
60 --source include/sync_slave_sql_with_master.inc
61
62 # Clean GTIDs on slave, so if a already retrieved transaction be asked
63 # again to the master, the transaction will be applied again, generating
64 # data inconsistency.
65 RESET MASTER;
66
67 # Restart the slave threads
68 --source include/stop_slave.inc
69 --source include/start_slave.inc
70
71 # Make sure the SQL thread is synced before checking consistency
72 --source include/rpl_connection_master.inc
73 --let $ignore_gtids_on_sync= 1
74 --source include/sync_slave_sql_with_master.inc
75
76 # Check t1 consistency
77 --source include/rpl_connection_master.inc
78 --let $diff_tables= master:t2, slave:t2
79 --source include/diff_tables.inc
80
81 #
82 # Cleanup
83 #
84
85 # Save slave Retrieved_Gtid_Set to add it as slave's GTID_PURGED
86 --source include/rpl_connection_slave.inc
87 --let $slave_gtid_purged= query_get_value(SHOW SLAVE STATUS, Retrieved_Gtid_Set, 1)
88 RESET MASTER;
89 --replace_result $master_uuid MASTER_UUID
90 --eval SET @@GLOBAL.GTID_PURGED='$slave_gtid_purged'
91
92 --source include/rpl_connection_master.inc
93 DROP TABLE t2;
94 --source include/rpl_end.inc