diff options
-rw-r--r-- | sql/wsrep_notify.cc | 3 | ||||
-rw-r--r-- | sql/wsrep_utils.cc | 13 | ||||
-rw-r--r-- | sql/wsrep_utils.h | 9 |
3 files changed, 11 insertions, 14 deletions
diff --git a/sql/wsrep_notify.cc b/sql/wsrep_notify.cc index 1de93d0d0e8..8446f11a34f 100644 --- a/sql/wsrep_notify.cc +++ b/sql/wsrep_notify.cc @@ -17,10 +17,13 @@ #include <mysqld.h> #include "wsrep_priv.h" #include "wsrep_utils.h" +#include "wsrep_status.h" void wsrep_notify_status(enum wsrep::server_state::state status, const wsrep::view* view) { + Wsrep_status::report_state(status); + if (!wsrep_notify_cmd || 0 == strlen(wsrep_notify_cmd)) { WSREP_INFO("wsrep_notify_cmd is not defined, skipping notification."); diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc index a1bbe2f61f8..a679304c40a 100644 --- a/sql/wsrep_utils.cc +++ b/sql/wsrep_utils.cc @@ -26,7 +26,6 @@ #include "wsrep_utils.h" #include "wsrep_mysqld.h" #include "wsrep_thd.h" -#include "wsrep_status.h" #include <sql_class.h> @@ -94,18 +93,6 @@ wsrep_prepend_PATH (const char* path) namespace wsp { -void -node_status::set(enum wsrep::server_state::state new_status, - const wsrep::view* view) -{ - if (status != new_status || 0 != view) - { - wsrep_notify_status(new_status, view); - status= new_status; - Wsrep_status::report_state(status); - } -} - bool env::ctor_common(char** e) { diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h index 39c0e56dac1..974c623521e 100644 --- a/sql/wsrep_utils.h +++ b/sql/wsrep_utils.h @@ -27,7 +27,14 @@ class node_status public: node_status() : status(wsrep::server_state::s_disconnected) {} void set(enum wsrep::server_state::state new_status, - const wsrep::view* view= 0); + const wsrep::view* view= 0) + { + if (status != new_status || 0 != view) + { + wsrep_notify_status(new_status, view); + status= new_status; + } + } enum wsrep::server_state::state get() const { return status; } private: enum wsrep::server_state::state status; |