Skip to content

Commit c5a4b3a

Browse files
authored
Merge pull request #219 from codership/GCF-1058-bugs-5.6-v25
Fix GCF-1058 MTR test galera.MW-86 fails on repeated runs
2 parents 1b47af4 + d921a77 commit c5a4b3a

File tree

7 files changed

+211
-157
lines changed

7 files changed

+211
-157
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
SELECT @@debug_sync;
2+
@@debug_sync
3+
ON - signals: ''
4+
SET SESSION wsrep_sync_wait = 1;
5+
SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
6+
CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
7+
INSERT INTO t_wait1 VALUES (1);
8+
SHOW BINARY LOGS;
9+
SHOW BINLOG EVENTS;
10+
SHOW COLUMNS FROM t1;
11+
SHOW CREATE EVENT e1;
12+
SHOW CREATE FUNCTION f1;
13+
SHOW CREATE PROCEDURE p1;
14+
SHOW CREATE TABLE t1;
15+
SHOW CREATE TRIGGER tr1;
16+
SHOW CREATE VIEW v1;
17+
SHOW DATABASES;
18+
SHOW ENGINE InnoDB STATUS;
19+
SHOW FUNCTION CODE f1;
20+
SHOW FUNCTION STATUS;
21+
SHOW GRANTS FOR 'root'@'localhost';
22+
SHOW INDEX FROM t1;
23+
SHOW OPEN TABLES;
24+
SHOW PROCEDURE CODE p1;
25+
SHOW PROCEDURE STATUS;
26+
SHOW PRIVILEGES;
27+
SHOW STATUS LIKE 'wsrep_cluster_size';
28+
SHOW TABLE STATUS;
29+
SHOW TABLES;
30+
SHOW TRIGGERS;
31+
SHOW GLOBAL VARIABLES LIKE 'foo_bar';
32+
SHOW WARNINGS;
33+
SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
34+
SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";
35+
SET SESSION wsrep_sync_wait = default;
36+
DROP TABLE t_wait1;
37+
SELECT @@debug_sync;
38+
@@debug_sync
39+
ON - signals: ''
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
SELECT @@debug_sync;
2+
@@debug_sync
3+
ON - signals: ''
4+
SET SESSION wsrep_sync_wait = 8;
5+
SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
6+
CREATE TABLE t_wait8 (f1 INTEGER) ENGINE=InnoDB;
7+
INSERT INTO t_wait8 VALUES (1);
8+
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
9+
SHOW BINARY LOGS;
10+
SHOW BINLOG EVENTS;
11+
SHOW COLUMNS FROM t1;
12+
SHOW CREATE DATABASE db1;
13+
SHOW CREATE EVENT e1;
14+
SHOW CREATE FUNCTION f1;
15+
SHOW CREATE PROCEDURE p1;
16+
SHOW CREATE TABLE t1;
17+
SHOW CREATE TRIGGER tr1;
18+
SHOW CREATE VIEW v1;
19+
SHOW DATABASES;
20+
SHOW ENGINE InnoDB STATUS;
21+
SHOW FUNCTION CODE f1;
22+
SHOW FUNCTION STATUS;
23+
SHOW GRANTS FOR 'root'@'localhost';
24+
SHOW INDEX FROM t1;
25+
SHOW OPEN TABLES;
26+
SHOW PROCEDURE CODE p1;
27+
SHOW PROCEDURE STATUS;
28+
SHOW PRIVILEGES;
29+
SHOW STATUS LIKE 'wsrep_cluster_size';
30+
SHOW TABLE STATUS;
31+
SHOW TABLES;
32+
SHOW TRIGGERS;
33+
SHOW GLOBAL VARIABLES LIKE 'foo_bar';
34+
SHOW WARNINGS;
35+
SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
36+
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
37+
SET SESSION wsrep_sync_wait = default;
38+
DROP TABLE t_wait8;
39+
SELECT @@debug_sync;
40+
@@debug_sync
41+
ON - signals: ''

mysql-test/suite/galera/r/MW-86.result

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--log-bin --log-slave-updates
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#
2+
# SHOW commands no longer obey wsrep_sync_wait = 1 (WSREP_SYNC_WAIT_BEFORE_READ)
3+
# (they do not wait for the background INSERT in the applier in node_2 to
4+
# complete)
5+
#
6+
--source include/galera_cluster.inc
7+
--source include/have_binlog_format_row.inc
8+
--source include/have_debug_sync.inc
9+
10+
--connection node_2
11+
# Make sure no signals have been leftover from previous tests to surprise us.
12+
SELECT @@debug_sync;
13+
14+
SET SESSION wsrep_sync_wait = 1;
15+
SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
16+
17+
--connection node_1
18+
CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
19+
# This will complete in node_1 but will start a background apply in node_2
20+
# which will stop because of sync.wsrep_apply_cb we set above.
21+
INSERT INTO t_wait1 VALUES (1);
22+
23+
--connection node_2
24+
25+
--disable_result_log
26+
27+
SHOW BINARY LOGS;
28+
29+
SHOW BINLOG EVENTS;
30+
31+
--error ER_NO_SUCH_TABLE
32+
SHOW COLUMNS FROM t1;
33+
34+
--error ER_EVENT_DOES_NOT_EXIST
35+
SHOW CREATE EVENT e1;
36+
37+
--error ER_SP_DOES_NOT_EXIST
38+
SHOW CREATE FUNCTION f1;
39+
40+
--error ER_SP_DOES_NOT_EXIST
41+
SHOW CREATE PROCEDURE p1;
42+
43+
--error ER_NO_SUCH_TABLE
44+
SHOW CREATE TABLE t1;
45+
46+
--error ER_TRG_DOES_NOT_EXIST
47+
SHOW CREATE TRIGGER tr1;
48+
49+
--error ER_NO_SUCH_TABLE
50+
SHOW CREATE VIEW v1;
51+
52+
SHOW DATABASES;
53+
54+
SHOW ENGINE InnoDB STATUS;
55+
56+
--error ER_SP_DOES_NOT_EXIST
57+
SHOW FUNCTION CODE f1;
58+
59+
SHOW FUNCTION STATUS;
60+
61+
SHOW GRANTS FOR 'root'@'localhost';
62+
63+
--error ER_NO_SUCH_TABLE
64+
SHOW INDEX FROM t1;
65+
66+
SHOW OPEN TABLES;
67+
68+
--error ER_SP_DOES_NOT_EXIST
69+
SHOW PROCEDURE CODE p1;
70+
71+
SHOW PROCEDURE STATUS;
72+
73+
SHOW PRIVILEGES;
74+
75+
SHOW STATUS LIKE 'wsrep_cluster_size';
76+
77+
SHOW TABLE STATUS;
78+
79+
SHOW TABLES;
80+
81+
SHOW TRIGGERS;
82+
83+
SHOW GLOBAL VARIABLES LIKE 'foo_bar';
84+
85+
--error 0
86+
SHOW WARNINGS;
87+
88+
--enable_result_log
89+
90+
# Unblock the background INSERT and remove the sync point.
91+
SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
92+
SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";
93+
94+
SET SESSION wsrep_sync_wait = default;
95+
96+
# This will wait for the background INSERT to complete before we quit
97+
# from the test.
98+
DROP TABLE t_wait1;
99+
100+
# Make sure no pending signals are leftover to surprise subsequent tests.
101+
SELECT @@debug_sync;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--log-bin --log-slave-updates
Lines changed: 28 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,30 @@
1-
--source include/galera_cluster.inc
2-
--source include/have_binlog_format_row.inc
3-
41
#
5-
# Test 1: SHOW commands no longer obey wsrep_sync_wait = 1
2+
# SHOW commands now obey wsrep_sync_wait = 8 (WSREP_SYNC_WAIT_BEFORE_SHOW)
63
#
4+
--source include/galera_cluster.inc
5+
--source include/have_binlog_format_row.inc
6+
--source include/have_debug_sync.inc
77

88
--connection node_2
9-
SET SESSION wsrep_sync_wait = 1;
10-
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
11-
--disable_result_log
12-
13-
--connection node_1
14-
CREATE DATABASE db1;
15-
16-
--connection node_2
17-
SHOW BINARY LOGS;
18-
19-
SHOW BINLOG EVENTS;
20-
21-
--error ER_NO_SUCH_TABLE
22-
SHOW COLUMNS FROM t1;
23-
24-
--error ER_BAD_DB_ERROR
25-
SHOW CREATE DATABASE db1;
26-
27-
--error ER_EVENT_DOES_NOT_EXIST
28-
SHOW CREATE EVENT e1;
29-
30-
--error ER_SP_DOES_NOT_EXIST
31-
SHOW CREATE FUNCTION f1;
32-
33-
--error ER_SP_DOES_NOT_EXIST
34-
SHOW CREATE PROCEDURE p1;
35-
36-
--error ER_NO_SUCH_TABLE
37-
SHOW CREATE TABLE t1;
38-
39-
--error ER_TRG_DOES_NOT_EXIST
40-
SHOW CREATE TRIGGER tr1;
41-
42-
--error ER_NO_SUCH_TABLE
43-
SHOW CREATE VIEW v1;
44-
45-
SHOW DATABASES;
46-
47-
SHOW ENGINE InnoDB STATUS;
48-
49-
--error ER_SP_DOES_NOT_EXIST
50-
SHOW FUNCTION CODE f1;
51-
52-
SHOW FUNCTION STATUS;
53-
54-
SHOW GRANTS FOR 'root'@'localhost';
55-
56-
--error ER_NO_SUCH_TABLE
57-
SHOW INDEX FROM t1;
58-
59-
SHOW OPEN TABLES;
60-
61-
--error ER_SP_DOES_NOT_EXIST
62-
SHOW PROCEDURE CODE p1;
63-
64-
SHOW PROCEDURE STATUS;
65-
66-
SHOW PRIVILEGES;
67-
68-
SHOW STATUS LIKE 'wsrep_cluster_size';
69-
70-
SHOW TABLE STATUS;
71-
72-
SHOW TABLES;
73-
74-
SHOW TRIGGERS;
75-
76-
SHOW GLOBAL VARIABLES LIKE 'foo_bar';
77-
78-
--error 0
79-
SHOW WARNINGS;
80-
81-
SET GLOBAL DEBUG = "";
82-
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
9+
# Make sure no signals have been leftover from previous tests to surprise us.
10+
SELECT @@debug_sync;
8311

8412
SET SESSION wsrep_sync_wait = 8;
85-
DROP DATABASE db1;
13+
SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
8614

87-
88-
#
89-
# Test 2: SHOW commands now obey wsrep_sync_wait = 8
90-
#
15+
--connection node_1
16+
CREATE TABLE t_wait8 (f1 INTEGER) ENGINE=InnoDB;
17+
# This will complete in node_1 but will start a background apply in node_2
18+
# which will stop because of sync.wsrep_apply_cb we set above.
19+
INSERT INTO t_wait8 VALUES (1);
9120

9221
--connection node_2
22+
9323
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
9424
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
95-
SET SESSION wsrep_sync_wait = 8;
96-
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
9725

98-
--connection node_1
99-
CREATE TABLE q (f1 INTEGER) ENGINE=InnoDB;
26+
--disable_result_log
10027

101-
--connection node_2
10228
--error ER_LOCK_WAIT_TIMEOUT
10329
SHOW BINARY LOGS;
10430

@@ -177,11 +103,21 @@ SHOW GLOBAL VARIABLES LIKE 'foo_bar';
177103
--error 0
178104
SHOW WARNINGS;
179105

180-
SET GLOBAL DEBUG = "";
181-
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
106+
--enable_result_log
182107

183108
--disable_query_log
184109
--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
110+
--enable_query_log
111+
112+
# Unblock the background INSERT and remove the sync point.
113+
SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
114+
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
115+
116+
SET SESSION wsrep_sync_wait = default;
117+
118+
# This will wait for the background INSERT to complete before we quit
119+
# from the test.
120+
DROP TABLE t_wait8;
185121

186-
SET SESSION wsrep_sync_wait = 15;
187-
DROP TABLE q;
122+
# Make sure no pending signals are leftover to surprise subsequent tests.
123+
SELECT @@debug_sync;

0 commit comments

Comments
 (0)