Skip to content

Commit

Permalink
MDEV-26971: JSON file interface to wsrep node state.
Browse files Browse the repository at this point in the history
Fix status reporting - move it from dead code to actually executing.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
  • Loading branch information
ayurchen authored and vuvova committed Mar 18, 2022
1 parent 7878eae commit eceb9e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
3 changes: 3 additions & 0 deletions sql/wsrep_notify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
13 changes: 0 additions & 13 deletions sql/wsrep_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "wsrep_utils.h"
#include "wsrep_mysqld.h"
#include "wsrep_thd.h"
#include "wsrep_status.h"

#include <sql_class.h>

Expand Down Expand Up @@ -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)
{
Expand Down
9 changes: 8 additions & 1 deletion sql/wsrep_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eceb9e2

Please sign in to comment.