1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-26971: JSON file interface to wsrep node state.

Integration with status reporter in wsrep-lib.

Status reporter reports changes in wsrep state and logged errors/
warnings to a json file which then can be read and interpreted by
an external monitoring tool.

Rationale: until the server is fully initialized it is unaccessible
by client and the only source of information is an error log which
is not machine-friendly. Since wsrep node can spend a very long time
in initialization phase (state transfer), it may be a very long time
that automatic tools can't easily monitor its liveness and progression.

New variable: wsrep_status_file specifies the output file name.
If not set, no file is created and no reporting is done.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
This commit is contained in:
Alexey Yurchenko
2021-09-05 17:07:05 +03:00
committed by Sergei Golubchik
parent d526551587
commit 9d7e596ba6
16 changed files with 193 additions and 3 deletions

View File

@@ -21,6 +21,20 @@
unsigned int wsrep_check_ip (const char* const addr, bool *is_ipv6);
size_t wsrep_guess_ip (char* buf, size_t buf_len);
namespace wsp {
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);
enum wsrep::server_state::state get() const { return status; }
private:
enum wsrep::server_state::state status;
};
} /* namespace wsp */
extern wsp::node_status local_status;
/* returns the length of the host part of the address string */
size_t wsrep_host_len(const char* addr, size_t addr_len);