File: rpl_bug58546.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 (98 lines) | stat: -rw-r--r-- 3,352 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
95
96
97
98
source include/have_debug.inc;
source include/have_debug_sync.inc;
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc;
source include/force_myisam_default.inc;
source include/have_myisam.inc;

--echo
--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
--echo # ----------------------------------------------------------------------
--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
--echo # possible that IO thread stopped after replicating part of a transaction
--echo # which SQL thread was executing. SQL thread would be hung if the
--echo # transaction could not be rolled back safely.
--echo # It caused some sporadic failures on PB2.
--echo #
--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
--echo # thread will continue to fetch the rest events of the transaction which
--echo # is being executed by SQL thread and is not able to be rolled back safely.

CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1, 1);

--source include/sync_slave_sql_with_master.inc
--source include/stop_slave.inc

--source include/rpl_connection_master.inc
# make sure there are no zombie threads
--source include/stop_dump_threads.inc

--let $debug_point= dump_thread_wait_before_send_xid
--source include/add_debug_point.inc

--source include/rpl_connection_slave.inc
--source include/start_slave.inc

BEGIN;
UPDATE t1 SET c2 = 2 WHERE c1 = 1;

--source include/rpl_connection_master.inc
BEGIN;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t2 VALUES(1);
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
COMMIT;

# wait for the dump thread to reach the sync point
--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKe '%debug sync point%' and command='Binlog Dump'
--source include/wait_condition.inc

--source include/rpl_connection_slave1.inc
let $show_statement= SHOW PROCESSLIST;
let $field= Info;
let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
source include/wait_show_condition.inc;

send STOP SLAVE;

--source include/rpl_connection_slave.inc
ROLLBACK;

--source include/rpl_connection_master.inc
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
# wait for the dump thread to come out of the
# waiting phase before resetting the signals
--let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump'
--source include/wait_condition.inc
SET DEBUG_SYNC= 'RESET';

--source include/rpl_connection_slave.inc
source include/wait_for_slave_to_stop.inc;

--source include/rpl_connection_slave1.inc
reap;

# Slave has stopped, thence lets make sure that
# we kill the zombie dump threads. Also, make
# sure that we disable the DBUG_EXECUTE_IF
# that would set the dump thread to wait
--source include/rpl_connection_master.inc

--let $debug_point= dump_thread_wait_before_send_xid
--source include/remove_debug_point.inc

# make sure that there are no zombie threads
--source include/stop_dump_threads.inc

--source include/rpl_connection_slave1.inc
# now the dump thread on the master will start
# from a clena slate, i.e. without the
# DBUG_EXECUTE_IF set
source include/start_slave.inc;

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