| 1 |
# |
| 2 |
# Desync will be done once the global read lock is acquired and resync will be done when |
| 3 |
# it is released. |
| 4 |
# Node should temporarily not participate in flow control |
| 5 |
# so even if fc_limit has been reached, the master should be able to continue to |
| 6 |
# commit transactions. |
| 7 |
# |
| 8 |
|
| 9 |
--source include/galera_cluster.inc |
| 10 |
--source include/have_innodb.inc |
| 11 |
|
| 12 |
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; |
| 13 |
INSERT INTO t1 VALUES (1); |
| 14 |
|
| 15 |
--connection node_2 |
| 16 |
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` |
| 17 |
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; |
| 18 |
|
| 19 |
# Block the slave applier thread |
| 20 |
FLUSH TABLES WITH READ LOCK; |
| 21 |
|
| 22 |
--connection node_1 |
| 23 |
|
| 24 |
# Without wsrep_desync = TRUE it would not be possible to perform 10 inserts on the master with gcs.fc_limit=1 |
| 25 |
INSERT INTO t1 VALUES (2); |
| 26 |
INSERT INTO t1 VALUES (3); |
| 27 |
INSERT INTO t1 VALUES (4); |
| 28 |
INSERT INTO t1 VALUES (5); |
| 29 |
INSERT INTO t1 VALUES (6); |
| 30 |
INSERT INTO t1 VALUES (7); |
| 31 |
INSERT INTO t1 VALUES (8); |
| 32 |
INSERT INTO t1 VALUES (9); |
| 33 |
INSERT INTO t1 VALUES (10); |
| 34 |
--sleep 1 |
| 35 |
|
| 36 |
--connection node_2 |
| 37 |
SET SESSION wsrep_sync_wait = 0; |
| 38 |
# No updates have arrived after the FLUSH TABLES |
| 39 |
SELECT COUNT(*) = 1 FROM t1; |
| 40 |
|
| 41 |
--disable_query_log |
| 42 |
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; |
| 43 |
--enable_query_log |
| 44 |
UNLOCK TABLES; |
| 45 |
|
| 46 |
SET SESSION wsrep_sync_wait = 1; |
| 47 |
# The slave is now fully caught up |
| 48 |
SELECT COUNT(*) = 10 FROM t1; |
| 49 |
|
| 50 |
--connection node_1 |
| 51 |
INSERT INTO t1 VALUES (11); |
| 52 |
|
| 53 |
--connection node_2 |
| 54 |
# Replication continues normally |
| 55 |
SELECT COUNT(*) = 11 FROM t1; |
| 56 |
|
| 57 |
CALL mtr.add_suppression("Protocol violation"); |
| 58 |
DROP TABLE t1; |
| 59 |
|
| 60 |
--connection node_1 |
| 61 |
CALL mtr.add_suppression("Protocol violation"); |