diff options
author | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-10-07 08:57:23 +0300 |
---|---|---|
committer | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-10-07 08:57:23 +0300 |
commit | 255e20a17534cf3b56201562990d5e5e01bccd33 (patch) | |
tree | 549ea21aabae5b114bc24707ec37873334203a6f /sql/wsrep_var.cc | |
parent | 06a7eeb992fe881f056fe83a8b716b3a81f224ff (diff) | |
download | mariadb-git-255e20a17534cf3b56201562990d5e5e01bccd33.tar.gz |
Merged revisions 3418..3424 from mariadb-galera-5.5
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r-- | sql/wsrep_var.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 8fa81376337..94ac902506f 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -470,6 +470,45 @@ bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type) } return false; } + +bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) +{ + bool new_wsrep_desync = var->value->val_bool(); + if (wsrep_desync == new_wsrep_desync) { + if (new_wsrep_desync) { + push_warning (thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_VAR, + "'wsrep_desync' is already ON."); + } else { + push_warning (thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_VAR, + "'wsrep_desync' is already OFF."); + } + } + return 0; +} + +bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) +{ + wsrep_status_t ret(WSREP_WARNING); + if (wsrep_desync) { + ret = wsrep->desync (wsrep); + if (ret != WSREP_OK) { + WSREP_WARN ("SET desync failed %d for %s", ret, thd->query()); + my_error (ER_CANNOT_USER, MYF(0), "'desync'", thd->query()); + return true; + } + } else { + ret = wsrep->resync (wsrep); + if (ret != WSREP_OK) { + WSREP_WARN ("SET resync failed %d for %s", ret, thd->query()); + my_error (ER_CANNOT_USER, MYF(0), "'resync'", thd->query()); + return true; + } + } + return false; +} + /* * Status variables stuff below */ |