summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2020-01-14 14:23:15 +0100
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2020-01-20 12:14:26 +0100
commit578b6ba02af4ecd0468e452578cebf3a2a506216 (patch)
treee1251c309fbc70c1f68bad69b9a0065ce96d6c67 /sql/wsrep_mysqld.cc
parent7993f893b844d71183956ee30a6fb37fc10ae90c (diff)
downloadmariadb-git-578b6ba02af4ecd0468e452578cebf3a2a506216.tar.gz
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).
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc6
1 files changed, 5 insertions, 1 deletions
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