Commit 9bacc9d0 authored by Jan Lindström's avatar Jan Lindström

MDEV-20505: Server crash on startup beacuse of bad wsrep configuration

Problem was that if user used bad wsrep configuration
we call unireg_abort and in wsrep case there is check
to wsrep_server_state that might not yet be initialized.
Fixed by checking that wsrep_server_state is initialized
before checking it's state.

Changes to be committed:
	modified:   sql/mysqld.cc
	modified:   sql/wsrep_server_state.h
parent 5c5452a5
......@@ -1879,6 +1879,7 @@ extern "C" void unireg_abort(int exit_code)
#ifdef WITH_WSREP
if (WSREP_ON &&
Wsrep_server_state::is_inited() &&
Wsrep_server_state::instance().state() != wsrep::server_state::s_disconnected)
{
/*
......@@ -5108,6 +5109,7 @@ static int init_server_components()
#ifdef WITH_WSREP
if (wsrep_init_server()) unireg_abort(1);
if (WSREP_ON && !wsrep_recovery && !opt_abort)
{
if (opt_bootstrap) // bootsrap option given - disable wsrep functionality
......
......@@ -35,11 +35,17 @@ class Wsrep_server_state : public wsrep::server_state
const wsrep::gtid& initial_position,
int max_protocol_version);
static void destroy();
static Wsrep_server_state& instance()
{
return *m_instance;
}
static bool is_inited()
{
return (m_instance != NULL);
}
static wsrep::provider& get_provider()
{
return instance().provider();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment