File: rpl_gtid_retrieve_last_trx.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 (71 lines) | stat: -rw-r--r-- 2,236 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
#
# ==== Purpose ====
#
# This test ensures that a fully retrieved transaction will not be asked to be
# retrieved again by the IO thread.
#
# The test first creates a transactional table and add some data on it. Then,
# it issues a "RESET MASTER" on the slave to make the slave to clean its
# GTID_EXECUTED, but the Retrieved_Gtid_Set is kept untouched.
# A restart in the IO thread with this situation should not make the IO thread
# to retrieve the last received transaction again. The test case test this by
# verifying the table consistency after syncing the slave SQL thread.
#
#
# ==== 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/master-slave.inc

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

#
# First part
#

# Put some data into master, finishing with a DML
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

# 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 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:t1, slave:t1
--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 t1;
--source include/rpl_end.inc