Skip to content

Commit 8b23832

Browse files
author
Joao Gramacho
committed
BUG#19641482 RPL.RPL_MTS_LOGICAL_CLOCK_RECOVERY FAILS WTH "SERVER FAILED
TO DISSAPPEAR" Problem ------- The test case is failing to make the slave server to "disappear". Analysis -------- The "crash_in_a_worker" debug sync point is relying on the fact that the workload will be parallelized and reach MTS worker #2, but on slow systems the parallelization will not happen and the server will fail to "disappear". Fix --- Ensure that the workload will be distributed by at all the workers even on slow systems.
1 parent 9f7c25e commit 8b23832

File tree

2 files changed

+75
-29
lines changed

2 files changed

+75
-29
lines changed

mysql-test/suite/rpl/r/rpl_mts_logical_clock_recovery.result

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,42 @@ Warnings:
33
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
44
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
55
[connection master]
6-
SET GLOBAL DEBUG ='+d,set_commit_parent_100';
6+
# Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug
77
CREATE TABLE t1 (a int primary key) engine=innodb;
88
CREATE TABLE t2 (a int primary key) engine=innodb;
99
CREATE TABLE t3 (a int primary key) engine=innodb;
1010
CREATE TABLE t4 (a int primary key) engine=innodb;
1111
include/sync_slave_sql_with_master.inc
12-
include/stop_slave.inc
13-
SET GLOBAL DEBUG ='+d,crash_in_a_worker';
14-
SET GLOBAL DEBUG ='-d,set_commit_parent_100';
15-
SET GLOBAL DEBUG ='+d,set_commit_parent_150';
16-
INSERT INTO t1 values (1),(2),(3);
12+
include/stop_slave_sql.inc
13+
# Adding debug point 'crash_in_a_worker' to @@GLOBAL.debug
14+
# Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug
15+
# Adding debug point 'set_commit_parent_150' to @@GLOBAL.debug
16+
INSERT INTO t1 values (0);
1717
BEGIN;
1818
INSERT INTO t2 values (1),(2),(3);
1919
UPDATE t2 SET a= a+1 WHERE a=3;
2020
COMMIT;
21+
BEGIN;
2122
INSERT INTO t3 values (1),(2),(3);
23+
UPDATE t3 SET a= a+1 WHERE a=3;
24+
COMMIT;
25+
BEGIN;
2226
INSERT INTO t4 values (1),(2),(3);
27+
UPDATE t4 SET a= a+1 WHERE a=3;
28+
COMMIT;
29+
BEGIN;
30+
INSERT INTO t1 values (1),(2),(3);
31+
UPDATE t1 SET a= a+1 WHERE a=3;
32+
COMMIT;
33+
# Removing debug point 'set_commit_parent_150' from @@GLOBAL.debug
34+
include/sync_slave_io_with_master.inc
35+
[connection slave1]
36+
BEGIN;
37+
INSERT INTO t1 (a) VALUES (4);
38+
INSERT INTO t2 (a) VALUES (4);
39+
INSERT INTO t3 (a) VALUES (4);
40+
INSERT INTO t4 (a) VALUES (4);
41+
[connection slave]
2342
START SLAVE;
2443
include/rpl_start_server.inc [server_number=2]
2544
# Reconnecting to the slave server

mysql-test/suite/rpl/t/rpl_mts_logical_clock_recovery.test

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,79 @@
44
-- source include/have_debug.inc
55
-- source include/not_valgrind.inc
66
-- source include/master-slave.inc
7-
-- let $saved_debug=`SELECT @@global.DEBUG`
8-
SET GLOBAL DEBUG ='+d,set_commit_parent_100';
7+
8+
--let $debug_point=set_commit_parent_100
9+
--source include/add_debug_point.inc
910

1011
# set up the tables and replicate it to the slave.
1112
CREATE TABLE t1 (a int primary key) engine=innodb;
1213
CREATE TABLE t2 (a int primary key) engine=innodb;
1314
CREATE TABLE t3 (a int primary key) engine=innodb;
1415
CREATE TABLE t4 (a int primary key) engine=innodb;
1516
-- source include/sync_slave_sql_with_master.inc
16-
-- source include/stop_slave.inc
17-
-- let $saved_debug_slave=`SELECT @@global.DEBUG`
18-
SET GLOBAL DEBUG ='+d,crash_in_a_worker';
17+
-- source include/stop_slave_sql.inc
18+
--let $debug_point=crash_in_a_worker
19+
--source include/add_debug_point.inc
1920

2021
-- connection master
21-
22-
SET GLOBAL DEBUG ='-d,set_commit_parent_100';
23-
SET GLOBAL DEBUG ='+d,set_commit_parent_150';
22+
--let $debug_point=set_commit_parent_100
23+
--source include/remove_debug_point.inc
24+
--let $debug_point=set_commit_parent_150
25+
--source include/add_debug_point.inc
2426

2527
# execute transactions
2628

27-
# TRX1
28-
INSERT INTO t1 values (1),(2),(3);
29+
# trx1 should be applied and its worker released for receiving more work.
30+
# trx2 to trx5 are prepared in a way that they will be scheduled on the slave
31+
# but will not be applied. In order to have all four transactions scheduled,
32+
# the coordinator will have to distribute work by all four workers. The test
33+
# case expects the slave to crash after some workload be distributed to the
34+
# worker #2.
2935

30-
# trx2 will fail on the slave.
36+
# trx1
37+
INSERT INTO t1 values (0);
38+
39+
# trx2 should not complete on the slave.
3140
BEGIN;
3241
INSERT INTO t2 values (1),(2),(3);
3342
UPDATE t2 SET a= a+1 WHERE a=3;
3443
COMMIT;
3544

36-
# trx3
45+
# trx3 should not complete on the slave.
46+
BEGIN;
3747
INSERT INTO t3 values (1),(2),(3);
48+
UPDATE t3 SET a= a+1 WHERE a=3;
49+
COMMIT;
3850

39-
# trx4
51+
# trx4 should not complete on the slave.
52+
BEGIN;
4053
INSERT INTO t4 values (1),(2),(3);
54+
UPDATE t4 SET a= a+1 WHERE a=3;
55+
COMMIT;
4156

42-
--disable_query_log ONCE
43-
--disable_result_log ONCE
44-
SET GLOBAL DEBUG ='$saved_debug';
57+
# trx5 should not complete on the slave.
58+
BEGIN;
59+
INSERT INTO t1 values (1),(2),(3);
60+
UPDATE t1 SET a= a+1 WHERE a=3;
61+
COMMIT;
62+
63+
--let $debug_point=set_commit_parent_150
64+
--source include/remove_debug_point.inc
65+
66+
# Make sure the workload is already on the relay log before starting the
67+
# applier to avoid issues with slow systems.
68+
--source include/sync_slave_io_with_master.inc
4569

46-
--connection slave
70+
# This should prevent trx2 to trx5 from committing and will make all
71+
# four MTS workers to be busy regardless of server speed.
72+
--source include/rpl_connection_slave1.inc
73+
BEGIN;
74+
INSERT INTO t1 (a) VALUES (4);
75+
INSERT INTO t2 (a) VALUES (4);
76+
INSERT INTO t3 (a) VALUES (4);
77+
INSERT INTO t4 (a) VALUES (4);
78+
79+
--source include/rpl_connection_slave.inc
4780
# make sure mtr expects a crash & restarts
4881
-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
4982
START SLAVE;
@@ -53,12 +86,6 @@ START SLAVE;
5386
-- enable_reconnect
5487
-- echo # Reconnecting to the slave server
5588
-- source include/wait_until_connected_again.inc
56-
-- connection slave
57-
-- disable_query_log ONCE
58-
-- disable_result_log ONCE
59-
-- disable_reconnect
60-
-- eval SET GLOBAL DEBUG ='$saved_debug_slave';
61-
6289
-- connection slave
6390
START SLAVE UNTIL SQL_AFTER_MTS_GAPS;
6491

0 commit comments

Comments
 (0)