From c8463ec1e6376bd03b923ac52fcce3ed077bcae3 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 14 Jan 2020 14:23:15 +0100 Subject: MDEV-19457: sys_vars.wsrep_provider_basic failed in buildbot If the initialization of the wsrep provider failed, in some cases the internal variable wrep_inited indicating that the initialization has already been completed is still set to "1", which then leads to confusion in the initialization status. To solve the problem, we should set this variable to "1" only if the wsrep provider initialization really completed successfully. An earlier issue has already been fixed for branch 10.4, and this patch contains a fix for earlier versions (where Galera 3.x is used). --- sql/wsrep_mysqld.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 0627127c6e0..c256467706b 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -599,7 +599,6 @@ int wsrep_init() { // enable normal operation in case no provider is specified wsrep_ready_set(TRUE); - wsrep_inited= 1; global_system_variables.wsrep_on = 0; wsrep_init_args args; args.logger_cb = wsrep_log_cb; @@ -610,10 +609,15 @@ int wsrep_init() { DBUG_PRINT("wsrep",("wsrep::init() failed: %d", rcode)); WSREP_ERROR("wsrep::init() failed: %d, must shutdown", rcode); + wsrep_ready_set(FALSE); wsrep->free(wsrep); free(wsrep); wsrep = NULL; } + else + { + wsrep_inited= 1; + } return rcode; } else -- cgit v1.2.1