Skip to content

Commit ab8b424

Browse files
committed
MDEV-37209 : mtr galera_3nodes.galera_garbd_backup test failures
This contains test case changes only. 1) Make sure InnoDB buffer pool has no dirty pages at begining 2) Use FTWRL to ensure tables are flushed to disk 3) Add wait condition to ensure tables and rows are replicated in the cluster 4) Use sort to ensure same order of the files in the find
1 parent b1c2963 commit ab8b424

File tree

2 files changed

+42
-32
lines changed

2 files changed

+42
-32
lines changed

mysql-test/suite/galera_3nodes/r/galera_garbd_backup.result

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,35 @@ connection node_1;
44
connection node_2;
55
connection node_3;
66
connection node_1;
7+
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
8+
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
79
SET GLOBAL innodb_max_dirty_pages_pct=99;
810
SET GLOBAL innodb_max_dirty_pages_pct_lwm=99;
9-
connection node_1;
1011
CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
1112
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
1213
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
1314
INSERT INTO t1 (f2) SELECT REPEAT('x', 1024) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
15+
FLUSH TABLES WITH READ LOCK;
16+
UNLOCK TABLES;
17+
connection node_2;
18+
SELECT COUNT(*) FROM t1;
19+
COUNT(*)
20+
10000
21+
SELECT COUNT(*) FROM ten;
22+
COUNT(*)
23+
10
1424
Killing node #3 to free ports for garbd ...
1525
connection node_3;
1626
connection node_1;
1727
SET GLOBAL debug_dbug = "+d,sync.wsrep_donor_state";
1828
Starting garbd ...
1929
SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_donor_state_reached";
20-
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0;
21-
SET GLOBAL innodb_max_dirty_pages_pct=0;
30+
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
31+
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
2232
SET SESSION debug_sync = "now SIGNAL signal.wsrep_donor_state";
2333
SET GLOBAL debug_dbug = "";
2434
SET debug_sync='RESET';
25-
connection node_2;
35+
connection node_1;
2636
Killing garbd ...
2737
connection node_1;
2838
connection node_2;
@@ -31,9 +41,3 @@ DROP TABLE ten;
3141
Restarting node #3 to satisfy MTR's end-of-test checks
3242
connection node_3;
3343
connection node_1;
34-
connection node_1;
35-
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
36-
connection node_2;
37-
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
38-
connection node_3;
39-
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

mysql-test/suite/galera_3nodes/t/galera_garbd_backup.test

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,34 @@
3232
--let $innodb_max_dirty_pages_pct = `SELECT @@innodb_max_dirty_pages_pct`
3333
--let $innodb_max_dirty_pages_pct_lwm = `SELECT @@innodb_max_dirty_pages_pct_lwm`
3434

35+
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
36+
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
37+
38+
--let $wait_condition = SELECT variable_value = 0 FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'
39+
--source include/wait_condition.inc
40+
3541
SET GLOBAL innodb_max_dirty_pages_pct=99;
3642
SET GLOBAL innodb_max_dirty_pages_pct_lwm=99;
3743

38-
--connection node_1
3944
CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
4045
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
4146
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
4247
INSERT INTO t1 (f2) SELECT REPEAT('x', 1024) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
48+
FLUSH TABLES WITH READ LOCK;
49+
UNLOCK TABLES;
50+
51+
--connection node_2
52+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
53+
--source include/wait_condition.inc
54+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ten'
55+
--source include/wait_condition.inc
56+
--let $wait_condition = SELECT COUNT(*) = 10 FROM ten
57+
--source include/wait_condition.inc
58+
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1
59+
--source include/wait_condition.inc
60+
61+
SELECT COUNT(*) FROM t1;
62+
SELECT COUNT(*) FROM ten;
4363

4464
--echo Killing node #3 to free ports for garbd ...
4565
--connection node_3
@@ -60,24 +80,20 @@ SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_donor_state_reached";
6080
#
6181
# get hash of data directory contents before BP dirty page flushing
6282
#
63-
--exec find $datadir -type f ! -name tables_flushed ! -name backup_sst_complete -exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_before
83+
--exec find $datadir -type f ! -name tables_flushed ! -name backup_sst_complete -print 0 -exec md5sum {} \; | sort -u | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_before
6484

6585
# this should force buffer pool flushing, if not already done by donor state change transfer
66-
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0;
67-
SET GLOBAL innodb_max_dirty_pages_pct=0;
86+
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
87+
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
6888

69-
--disable_query_log
70-
--disable_result_log
71-
select f1 from t1;
72-
select * from ten;
73-
--enable_result_log
74-
--enable_query_log
89+
--let $wait_condition = SELECT variable_value = 0 FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'
90+
--source include/wait_condition.inc
7591

7692
#
7793
#
7894
# record the hash of data directory contents after BP dirty page flushing
7995
#
80-
--exec find $datadir -type f ! -name tables_flushed ! -name backup_sst_complete -exec md5sum {} \; | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_after
96+
--exec find $datadir -type f ! -name tables_flushed ! -name backup_sst_complete -print 0 -exec md5sum {} \; | sort -u | md5sum >$MYSQLTEST_VARDIR/tmp/innodb_after
8197

8298
# there should be no disk writes
8399
--diff_files $MYSQLTEST_VARDIR/tmp/innodb_before $MYSQLTEST_VARDIR/tmp/innodb_after
@@ -86,7 +102,7 @@ SET SESSION debug_sync = "now SIGNAL signal.wsrep_donor_state";
86102
SET GLOBAL debug_dbug = "";
87103
SET debug_sync='RESET';
88104

89-
--connection node_2
105+
--connection node_1
90106

91107
#
92108
# garbd will die automatically, because of the backup SST script
@@ -122,13 +138,3 @@ let $restart_noprint=2;
122138
# Restore original auto_increment_offset values.
123139
--source ../galera/include/auto_increment_offset_restore.inc
124140

125-
# Workaround for galera#101
126-
127-
--connection node_1
128-
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
129-
130-
--connection node_2
131-
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
132-
133-
--connection node_3
134-
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

0 commit comments

Comments
 (0)