Skip to content

Commit 5960815

Browse files
authored
Merge pull request #844 from codership/10.1-MDEV-15933
MDEV-15933 Cannot resume Node SYNCED state when wsrep_desync is done after FTWRL
2 parents 68eb9b1 + dfb19c0 commit 5960815

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

mysql-test/suite/galera/r/galera_var_desync_on.result

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
22
INSERT INTO t1 VALUES (1);
33
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
4-
SET GLOBAL wsrep_desync = TRUE;
54
FLUSH TABLES WITH READ LOCK;
65
INSERT INTO t1 VALUES (2);
76
INSERT INTO t1 VALUES (3);
@@ -16,7 +15,6 @@ SET SESSION wsrep_sync_wait = 0;
1615
SELECT COUNT(*) = 1 FROM t1;
1716
COUNT(*) = 1
1817
1
19-
SET GLOBAL wsrep_desync = FALSE;
2018
UNLOCK TABLES;
2119
SET SESSION wsrep_sync_wait = 1;
2220
SELECT COUNT(*) = 10 FROM t1;

mysql-test/suite/galera/t/galera_var_desync_on.test

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#
2-
# Test wsrep_desync = ON . Node should temporarily not participate in flow control
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
35
# so even if fc_limit has been reached, the master should be able to continue to
46
# commit transactions.
57
#
@@ -13,7 +15,6 @@ INSERT INTO t1 VALUES (1);
1315
--connection node_2
1416
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
1517
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
16-
SET GLOBAL wsrep_desync = TRUE;
1718

1819
# Block the slave applier thread
1920
FLUSH TABLES WITH READ LOCK;
@@ -37,8 +38,6 @@ SET SESSION wsrep_sync_wait = 0;
3738
# No updates have arrived after the FLUSH TABLES
3839
SELECT COUNT(*) = 1 FROM t1;
3940

40-
# Resync the slave
41-
SET GLOBAL wsrep_desync = FALSE;
4241
--disable_query_log
4342
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
4443
--enable_query_log

sql/wsrep_var.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,12 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var)
587587
return true;
588588
}
589589

590+
if (thd->global_read_lock.is_acquired())
591+
{
592+
my_message (ER_CANNOT_USER, "Global read lock acquired. Can't set 'wsrep_desync'", MYF(0));
593+
return true;
594+
}
595+
590596
bool new_wsrep_desync= (bool) var->save_result.ulonglong_value;
591597
if (wsrep_desync == new_wsrep_desync) {
592598
if (new_wsrep_desync) {

0 commit comments

Comments
 (0)