summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2012-06-21 11:52:54 +0200
committerunknown <knielsen@knielsen-hq.org>2012-06-21 11:52:54 +0200
commit5e13093df198bc171e1e43c03a36970ecf9a77f7 (patch)
tree856bb35161690cdd780d72419fdb6927dbb15ede /plugin
parent39005ea06f1c5d0aa9d7e55c8f4000477f26b74b (diff)
downloadmariadb-git-5e13093df198bc171e1e43c03a36970ecf9a77f7.tar.gz
MDEV-359: Server crash when SET GLOBAL rpl_semi_sync_master_enabled = OFF
The semisync code does a fast-but-unsafe check for enabled or not without lock, followed by a slow-but-safe check under lock. However, if the slow check failed, the code still referenced not valid data (in an assert() expression), causing a crash. Fixed by not running the incorrect assert when semisync is disabled.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/semisync/semisync_master.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index 9e857f83d39..cb60d8e67d3 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -608,6 +608,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
set_timespec(start_ts, 0);
+ DEBUG_SYNC(current_thd, "rpl_semisync_master_commit_trx_before_lock");
/* Acquire the mutex. */
lock();
@@ -738,7 +739,6 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
}
}
- l_end:
/*
At this point, the binlog file and position of this transaction
must have been removed from ActiveTranx.
@@ -747,6 +747,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name,
trx_wait_binlog_pos));
+ l_end:
/* Update the status counter. */
if (is_on())
rpl_semi_sync_master_yes_transactions++;