mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
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.
This commit is contained in:
9
mysql-test/suite/wsrep/r/trans.result
Normal file
9
mysql-test/suite/wsrep/r/trans.result
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# 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.
|
||||
13
mysql-test/suite/wsrep/t/trans.test
Normal file
13
mysql-test/suite/wsrep/t/trans.test
Normal file
@@ -0,0 +1,13 @@
|
||||
--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)
|
||||
{
|
||||
binlog_hton= (handlerton *)p;
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_ON)
|
||||
if (WSREP_ON && WSREP_PROVIDER_EXISTS)
|
||||
binlog_hton->state= SHOW_OPTION_YES;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4909,7 +4909,7 @@ pthread_handler_t start_wsrep_THD(void *arg)
|
||||
|
||||
void wsrep_create_rollbacker()
|
||||
{
|
||||
if (wsrep_provider && strcasecmp(wsrep_provider, "none"))
|
||||
if (WSREP_PROVIDER_EXISTS)
|
||||
{
|
||||
pthread_t hThread;
|
||||
/* create rollbacker */
|
||||
@@ -4925,7 +4925,7 @@ void wsrep_create_appliers(long threads)
|
||||
{
|
||||
/* see wsrep_replication_start() for the logic */
|
||||
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 "
|
||||
"connection at '%s'", wsrep_cluster_address);
|
||||
|
||||
@@ -438,8 +438,7 @@ int wsrep_init()
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(wsrep_provider)== 0 ||
|
||||
!strcmp(wsrep_provider, WSREP_NONE))
|
||||
if (!WSREP_PROVIDER_EXISTS)
|
||||
{
|
||||
// enable normal operation in case no provider is specified
|
||||
wsrep_ready_set(TRUE);
|
||||
@@ -662,8 +661,7 @@ bool wsrep_start_replication()
|
||||
if provider is trivial, don't even try to connect,
|
||||
but resume local node operation
|
||||
*/
|
||||
if (strlen(wsrep_provider)== 0 ||
|
||||
!strcmp(wsrep_provider, WSREP_NONE))
|
||||
if (!WSREP_PROVIDER_EXISTS)
|
||||
{
|
||||
// enable normal operation in case no provider is specified
|
||||
wsrep_ready_set(TRUE);
|
||||
|
||||
@@ -286,6 +286,9 @@ extern wsrep_seqno_t wsrep_locked_seqno;
|
||||
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 */
|
||||
extern void wsrep_sst_grab();
|
||||
/*! Init thread waits for SST completion */
|
||||
|
||||
Reference in New Issue
Block a user