| 1 |
# |
| 2 |
# Test that under gcs.fc_limit=1 on the slave, transactions on the master can not commit. |
| 3 |
# |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/big_test.inc |
| 7 |
--source include/force_restart.inc |
| 8 |
|
| 9 |
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,B INTEGER) ENGINE=InnoDB; |
| 10 |
INSERT INTO t1 VALUES (1,1); |
| 11 |
|
| 12 |
--connection node_2 |
| 13 |
--let $wait_condition = SELECT COUNT(*)=1 FROM t1; |
| 14 |
--source include/wait_condition.inc |
| 15 |
|
| 16 |
SELECT COUNT(*) FROM t1; |
| 17 |
|
| 18 |
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` |
| 19 |
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; |
| 20 |
|
| 21 |
# Block the slave applier thread |
| 22 |
LOCK TABLE t1 WRITE; |
| 23 |
|
| 24 |
--connection node_1 |
| 25 |
FLUSH STATUS; |
| 26 |
INSERT INTO t1 VALUES (2,2); |
| 27 |
INSERT INTO t1 VALUES (3,3); |
| 28 |
INSERT INTO t1 VALUES (4,4); |
| 29 |
|
| 30 |
# This query will hang because flow control will kick in |
| 31 |
--send |
| 32 |
INSERT INTO t1(B) SELECT B FROM t1; |
| 33 |
|
| 34 |
--let $galera_connection_name = node_1a |
| 35 |
--let $galera_server_number = 1 |
| 36 |
--source include/galera_connect.inc |
| 37 |
--connection node_1a |
| 38 |
|
| 39 |
--echo # In node_1 either insert or commit should be stuck |
| 40 |
--let $wait_condition = SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_flow_control_paused'; |
| 41 |
--source include/wait_condition.inc |
| 42 |
|
| 43 |
--connection node_2 |
| 44 |
# Unblock the slave applier thread |
| 45 |
UNLOCK TABLES; |
| 46 |
|
| 47 |
--connection node_1 |
| 48 |
--reap |
| 49 |
|
| 50 |
INSERT INTO t1 VALUES (NULL,6); |
| 51 |
|
| 52 |
--connection node_2 |
| 53 |
# Replication catches up and continues normally |
| 54 |
SELECT COUNT(*) FROM t1; |
| 55 |
|
| 56 |
--disable_query_log |
| 57 |
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; |
| 58 |
--enable_query_log |
| 59 |
--source include/wait_until_connected_again.inc |
| 60 |
|
| 61 |
DROP TABLE t1; |