Skip to content

Commit

Permalink
MDEV-17061: Test failure on galera.galera_gcs_fc_limit
Browse files Browse the repository at this point in the history
Remove unnecessary sleeps and fix wait_condition to use
wsrep_flow_control_paused i.e. we wait until flow control
pauses a transaction on master.
  • Loading branch information
Jan Lindström committed May 17, 2019
1 parent fae6539 commit bc51144
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
1 change: 0 additions & 1 deletion mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_
galera_binlog_stmt_autoinc : MDEV-13549 auto_increment mismatch
galera_flush : MariaDB does not have global.thread_statistics
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_gcs_fc_limit : MDEV-17061 Timeout in wait_condition.inc for PROCESSLIST
galera_ist_mariabackup : MDEV-18829 test leaves port open
galera_ist_progress: MDEV-15236 fails when trying to read transfer status
galera_kill_applier : race condition at the start of the test
Expand Down
27 changes: 15 additions & 12 deletions mysql-test/suite/galera/r/galera_gcs_fc_limit.result
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,B INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SET SESSION wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
LOCK TABLE t1 WRITE;
connection node_1;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
FLUSH STATUS;
INSERT INTO t1 VALUES (2,2);
INSERT INTO t1 VALUES (3,3);
INSERT INTO t1 VALUES (4,4);
INSERT INTO t1(B) SELECT B FROM t1;
connection node_1a;
# In node_1 either insert or commit should be stuck
connection node_2;
UNLOCK TABLES;
connection node_1;
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (NULL,6);
connection node_2;
SELECT COUNT(*) = 6 FROM t1;
COUNT(*) = 6
1
SELECT COUNT(*) FROM t1;
COUNT(*)
9
DROP TABLE t1;
30 changes: 14 additions & 16 deletions mysql-test/suite/galera/t/galera_gcs_fc_limit.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc

CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,B INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1);

--connection node_2
SELECT COUNT(*) = 1 FROM t1;
--sleep 1
SET SESSION wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;

--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
Expand All @@ -19,24 +19,22 @@ SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
LOCK TABLE t1 WRITE;

--connection node_1
--sleep 1
INSERT INTO t1 VALUES (2);
--sleep 2
INSERT INTO t1 VALUES (3);
--sleep 2
INSERT INTO t1 VALUES (4);
--sleep 2
FLUSH STATUS;
INSERT INTO t1 VALUES (2,2);
INSERT INTO t1 VALUES (3,3);
INSERT INTO t1 VALUES (4,4);

# This query will hang because flow control will kick in
--send
INSERT INTO t1 VALUES (5);
--sleep 2
INSERT INTO t1(B) SELECT B FROM t1;

--let $galera_connection_name = node_1a
--let $galera_server_number = 1
--source include/galera_connect.inc
--connection node_1a
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'query end' AND INFO = 'INSERT INTO t1 VALUES (5)';

--echo # In node_1 either insert or commit should be stuck
--let $wait_condition = SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_flow_control_paused';
--source include/wait_condition.inc

--connection node_2
Expand All @@ -46,11 +44,11 @@ UNLOCK TABLES;
--connection node_1
--reap

INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (NULL,6);

--connection node_2
# Replication catches up and continues normally
SELECT COUNT(*) = 6 FROM t1;
SELECT COUNT(*) FROM t1;

--disable_query_log
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
Expand Down

0 comments on commit bc51144

Please sign in to comment.