diff options
author | Alexey Yurchenko <ayurchen@galeracluster.com> | 2016-04-02 22:37:22 -0300 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-08-21 16:17:08 -0400 |
commit | d45b58263ddf815aa04d4dbc9255ed1081e33bdb (patch) | |
tree | a39cca86f7ba93d8eb35f9514a648238503bd9a3 | |
parent | 4582a4bccf406776702a3f866a8f21aa4daaaff9 (diff) | |
download | mariadb-git-d45b58263ddf815aa04d4dbc9255ed1081e33bdb.tar.gz |
MW-259 - moved wsrep desync/resync calls from wsrep_desync_update() to wsrep_desync_check() method which does not hold the lock and is arguably a more fitting place to change provider state - before changing the actual variable value.
-rw-r--r-- | mysql-test/suite/galera/r/MW-259.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/MW-259.test | 42 | ||||
-rw-r--r-- | sql/wsrep_var.cc | 13 |
3 files changed, 61 insertions, 6 deletions
diff --git a/mysql-test/suite/galera/r/MW-259.result b/mysql-test/suite/galera/r/MW-259.result new file mode 100644 index 00000000000..df76e959de5 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-259.result @@ -0,0 +1,12 @@ +CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; +SET GLOBAL wsrep_desync=0; +Warnings: +Warning 1231 'wsrep_desync' is already OFF. +SET wsrep_OSU_method=RSU; +SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; +ALTER TABLE t1 ADD COLUMN f2 INTEGER;; +SET GLOBAL wsrep_desync=1;; +SET DEBUG_SYNC= 'now SIGNAL continue'; +DROP TABLE t1; +SET GLOBAL wsrep_desync=0; +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/galera/t/MW-259.test b/mysql-test/suite/galera/t/MW-259.test new file mode 100644 index 00000000000..ff9a30deed3 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-259.test @@ -0,0 +1,42 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; + +SET GLOBAL wsrep_desync=0; +SET wsrep_OSU_method=RSU; + +SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; +--send ALTER TABLE t1 ADD COLUMN f2 INTEGER; + +--connection node_1a + +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables' +--source include/wait_condition.inc + +# wsrep_desync=1 will block +--send SET GLOBAL wsrep_desync=1; + +--connection node_1b +--sleep 2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'exit open_tables()' and INFO = 'SET GLOBAL wsrep_desync=1' +--source include/wait_condition.inc + +SET DEBUG_SYNC= 'now SIGNAL continue'; +DROP TABLE t1; +SET GLOBAL wsrep_desync=0; + +--connection node_1 +--reap + +--connection node_1a +--reap + +# Cleanup +SET DEBUG_SYNC= 'RESET'; + diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 44d17e3e78a..2f13ffd6747 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -529,14 +529,10 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) ER_WRONG_VALUE_FOR_VAR, "'wsrep_desync' is already OFF."); } + return false; } - return 0; -} - -bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) -{ wsrep_status_t ret(WSREP_WARNING); - if (wsrep_desync) { + if (new_wsrep_desync) { ret = wsrep->desync (wsrep); if (ret != WSREP_OK) { WSREP_WARN ("SET desync failed %d for schema: %s, query: %s", ret, @@ -558,6 +554,11 @@ bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) return false; } +bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) +{ + return false; +} + bool wsrep_max_ws_size_update (sys_var *self, THD *thd, enum_var_type) { char max_ws_size_opt[128]; |