Commit 8154ef4b authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-7067: Server outputs Galera (WSREP) information, even if Galera is disabled

Additional changes :
* On startup, do not initialize wsrep if wsrep_on=0.
* On shutdown, stop wsrep replication only if > 0 wsrep
threads are running.
parent b08c4201
...@@ -1902,7 +1902,10 @@ static void __cdecl kill_server(int sig_ptr) ...@@ -1902,7 +1902,10 @@ static void __cdecl kill_server(int sig_ptr)
#endif #endif
/* Stop wsrep threads in case they are running. */ /* Stop wsrep threads in case they are running. */
wsrep_stop_replication(NULL); if (wsrep_running_threads > 0)
{
wsrep_stop_replication(NULL);
}
close_connections(); close_connections();
...@@ -5806,10 +5809,6 @@ int mysqld_main(int argc, char **argv) ...@@ -5806,10 +5809,6 @@ int mysqld_main(int argc, char **argv)
wsrep_create_appliers(wsrep_slave_threads - 1); wsrep_create_appliers(wsrep_slave_threads - 1);
} }
} }
else
{
wsrep_init_startup (false);
}
if (opt_bootstrap) if (opt_bootstrap)
{ {
......
...@@ -552,33 +552,34 @@ int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff, ...@@ -552,33 +552,34 @@ int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff,
*v++= wsrep_status_vars[i]; *v++= wsrep_status_vars[i];
DBUG_ASSERT(i < maxi); DBUG_ASSERT(i < maxi);
DBUG_ASSERT(wsrep != NULL);
wsrep_stats_var* stats= wsrep->stats_get(wsrep); if (wsrep != NULL) {
for (wsrep_stats_var *sv= stats; i < maxi && sv && sv->name; i++, sv++, v++) wsrep_stats_var* stats= wsrep->stats_get(wsrep);
{ for (wsrep_stats_var *sv= stats; i < maxi && sv && sv->name; i++, sv++, v++)
v->name = thd->strdup(sv->name); {
switch (sv->type) { v->name = thd->strdup(sv->name);
case WSREP_VAR_INT64: switch (sv->type) {
v->value = (char*)thd->memdup(&sv->value._int64, sizeof(longlong)); case WSREP_VAR_INT64:
v->type = SHOW_LONGLONG; v->value = (char*)thd->memdup(&sv->value._int64, sizeof(longlong));
break; v->type = SHOW_LONGLONG;
case WSREP_VAR_STRING: break;
v->value = thd->strdup(sv->value._string); case WSREP_VAR_STRING:
v->type = SHOW_CHAR; v->value = thd->strdup(sv->value._string);
break; v->type = SHOW_CHAR;
case WSREP_VAR_DOUBLE: break;
v->value = (char*)thd->memdup(&sv->value._double, sizeof(double)); case WSREP_VAR_DOUBLE:
v->type = SHOW_DOUBLE; v->value = (char*)thd->memdup(&sv->value._double, sizeof(double));
break; v->type = SHOW_DOUBLE;
break;
}
DBUG_ASSERT(i < maxi);
} }
DBUG_ASSERT(i < maxi); wsrep->stats_free(wsrep, stats);
} }
wsrep->stats_free(wsrep, stats);
my_qsort(buff, i, sizeof(*v), show_var_cmp); my_qsort(buff, i, sizeof(*v), show_var_cmp);
v->name= 0; // terminator v->name= 0; // terminator
return 0; return 0;
} }
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