File: rpl_gtid_retrieve_last_trx_myisam.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (94 lines) | stat: -rw-r--r-- 2,864 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# ==== Purpose ====
#
# This test ensures that a fully retrieved transaction will not be asked to be
# retrieved again by the IO thread.
#
# The first  part of the test repeats the above procedure making the last
# transaction to be retrieved by IO thread to be a DDL (without XID or
# QUERY(COMMIT) events to mark its end).
#
# The second part of the test repeats the first part procedure by inserting
# data into a non-transactional table.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#17943188: SHOW SLAVE STATUS/RETRIEVED_GTID_SET MAY HAVE PARTIAL TRX OR
#               MISS COMPLETE TRX
# BUG#18629623: INCONSISTENT DATA IN GTID (RESET MASTER, STOP SLAVE, START
#               SLAVE)
#
--source include/not_group_replication_plugin.inc
--source include/force_myisam_default.inc
--source include/have_myisam.inc

--source include/master-slave.inc

# Get the master UUID to filter displayed data
--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`

#
#  First part
#

# Now finishing with a DDL (no XID or QUERY(COMMIT) at the end of trx)
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;

# Sync slave with master
--source include/sync_slave_sql_with_master.inc

# Clean GTIDs on slave, so if a already retrieved transaction be asked
# again to the master, the transaction will be applied again, generating
# data inconsistency.
RESET MASTER;

# Restart the slave threads
--source include/stop_slave.inc
--source include/start_slave.inc

# Make sure the SQL thread is synced without errors
--source include/rpl_connection_master.inc
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Put some data into master into a non-trx table, finishing with a DML
--source include/rpl_connection_master.inc
INSERT INTO t2 VALUES (1);

# Sync slave with master
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Clean GTIDs on slave, so if a already retrieved transaction be asked
# again to the master, the transaction will be applied again, generating
# data inconsistency.
RESET MASTER;

# Restart the slave threads
--source include/stop_slave.inc
--source include/start_slave.inc

# Make sure the SQL thread is synced before checking consistency
--source include/rpl_connection_master.inc
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Check t1 consistency
--source include/rpl_connection_master.inc
--let $diff_tables= master:t2, slave:t2
--source include/diff_tables.inc

#
# Cleanup
#

# Save slave Retrieved_Gtid_Set to add it as slave's GTID_PURGED
--source include/rpl_connection_slave.inc
--let $slave_gtid_purged= query_get_value(SHOW SLAVE STATUS, Retrieved_Gtid_Set, 1)
RESET MASTER;
--replace_result $master_uuid MASTER_UUID
--eval SET @@GLOBAL.GTID_PURGED='$slave_gtid_purged'

--source include/rpl_connection_master.inc
DROP TABLE t2;
--source include/rpl_end.inc