Commit 6271c06a authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-4222: Assertion `( ((global_system_variables.wsrep_on) &&

  (thd && thd->variables.wsrep_on)) && wsrep_emulate_bin_log) ||
  mysql_bin_log .is_open()' fails on SAVEPOINT with disabled
  wsrep_provider

As wsrep_on system variable is ON by default the binlog handlerton
is implicitly enabled during the server initialization phase. Later,
while wsrep plugin is getting initialized, wsrep_on in corrected &
turned OFF in case wsrep provider is not specified (leaving binlog
in ON state!). This leads to the reported assertion.

Fixed by adding another check for wsrep provider before binlog
is enabled.

Added a test case.
parent 62bd131d
#
# MDEV-4222 : Assertion `( ((global_system_variables.wsrep_on) &&
# (thd && thd->variables.wsrep_on)) && srep_emulate_bin_log)
# || mysql_bin_log .is_open()' fails on SAVEPOINT with
# disabled wsrep_provider
#
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SAVEPOINT A;
End of test.
--source include/have_innodb.inc
--echo #
--echo # MDEV-4222 : Assertion `( ((global_system_variables.wsrep_on) &&
--echo # (thd && thd->variables.wsrep_on)) && srep_emulate_bin_log)
--echo # || mysql_bin_log .is_open()' fails on SAVEPOINT with
--echo # disabled wsrep_provider
--echo #
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SAVEPOINT A;
--echo End of test.
...@@ -1708,7 +1708,7 @@ int binlog_init(void *p) ...@@ -1708,7 +1708,7 @@ int binlog_init(void *p)
{ {
binlog_hton= (handlerton *)p; binlog_hton= (handlerton *)p;
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (WSREP_ON) if (WSREP_ON && WSREP_PROVIDER_EXISTS)
binlog_hton->state= SHOW_OPTION_YES; binlog_hton->state= SHOW_OPTION_YES;
else else
{ {
......
...@@ -4909,7 +4909,7 @@ pthread_handler_t start_wsrep_THD(void *arg) ...@@ -4909,7 +4909,7 @@ pthread_handler_t start_wsrep_THD(void *arg)
void wsrep_create_rollbacker() void wsrep_create_rollbacker()
{ {
if (wsrep_provider && strcasecmp(wsrep_provider, "none")) if (WSREP_PROVIDER_EXISTS)
{ {
pthread_t hThread; pthread_t hThread;
/* create rollbacker */ /* create rollbacker */
...@@ -4925,7 +4925,7 @@ void wsrep_create_appliers(long threads) ...@@ -4925,7 +4925,7 @@ void wsrep_create_appliers(long threads)
{ {
/* see wsrep_replication_start() for the logic */ /* see wsrep_replication_start() for the logic */
if (wsrep_cluster_address && strlen(wsrep_cluster_address) && if (wsrep_cluster_address && strlen(wsrep_cluster_address) &&
wsrep_provider && strcasecmp(wsrep_provider, "none")) WSREP_PROVIDER_EXISTS)
{ {
WSREP_ERROR("Trying to launch slave threads before creating " WSREP_ERROR("Trying to launch slave threads before creating "
"connection at '%s'", wsrep_cluster_address); "connection at '%s'", wsrep_cluster_address);
......
...@@ -438,8 +438,7 @@ int wsrep_init() ...@@ -438,8 +438,7 @@ int wsrep_init()
} }
} }
if (strlen(wsrep_provider)== 0 || if (!WSREP_PROVIDER_EXISTS)
!strcmp(wsrep_provider, WSREP_NONE))
{ {
// enable normal operation in case no provider is specified // enable normal operation in case no provider is specified
wsrep_ready_set(TRUE); wsrep_ready_set(TRUE);
...@@ -662,8 +661,7 @@ bool wsrep_start_replication() ...@@ -662,8 +661,7 @@ bool wsrep_start_replication()
if provider is trivial, don't even try to connect, if provider is trivial, don't even try to connect,
but resume local node operation but resume local node operation
*/ */
if (strlen(wsrep_provider)== 0 || if (!WSREP_PROVIDER_EXISTS)
!strcmp(wsrep_provider, WSREP_NONE))
{ {
// enable normal operation in case no provider is specified // enable normal operation in case no provider is specified
wsrep_ready_set(TRUE); wsrep_ready_set(TRUE);
......
...@@ -286,6 +286,9 @@ extern wsrep_seqno_t wsrep_locked_seqno; ...@@ -286,6 +286,9 @@ extern wsrep_seqno_t wsrep_locked_seqno;
if (victim_thd) WSREP_LOG_CONFLICT_THD(victim_thd, "Victim thread"); \ if (victim_thd) WSREP_LOG_CONFLICT_THD(victim_thd, "Victim thread"); \
} }
#define WSREP_PROVIDER_EXISTS \
(wsrep_provider && strncasecmp(wsrep_provider, WSREP_NONE, FN_REFLEN))
/*! Synchronizes applier thread start with init thread */ /*! Synchronizes applier thread start with init thread */
extern void wsrep_sst_grab(); extern void wsrep_sst_grab();
/*! Init thread waits for SST completion */ /*! Init thread waits for SST completion */
......
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