summaryrefslogtreecommitdiff
path: root/plugin/semisync/semisync_master.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-11-13 23:43:11 +0200
committerMonty <monty@mariadb.org>2015-11-14 00:04:29 +0200
commita9cda4419becd34e956b1657d2cc5a07644c96bf (patch)
tree51d34ec06a6d28c75fc2ae8e3ed9eaa56db28bc1 /plugin/semisync/semisync_master.cc
parent2776159e424dc04ef162b9cc0a2bd075419e0eb4 (diff)
downloadmariadb-git-a9cda4419becd34e956b1657d2cc5a07644c96bf.tar.gz
MDEV-8066 Crash on unloading semisync_master plugin
Bug was that ReplSemiSyncMaster::commitTrx() was waiting on a condition for state to change, but didn't take into account that one could have disabled semi-sync during the wait.
Diffstat (limited to 'plugin/semisync/semisync_master.cc')
-rw-r--r--plugin/semisync/semisync_master.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index bb9eb96f6d7..af5eb9d090d 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -477,6 +477,7 @@ void ReplSemiSyncMaster::add_slave()
void ReplSemiSyncMaster::remove_slave()
{
lock();
+ assert(rpl_semi_sync_master_clients > 0);
rpl_semi_sync_master_clients--;
/* Only switch off if semi-sync is enabled and is on */
@@ -744,8 +745,10 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
/*
At this point, the binlog file and position of this transaction
must have been removed from ActiveTranx.
+ active_tranxs_ may be NULL if someone disabled semi sync during
+ cond_timewait()
*/
- assert(thd_killed(NULL) ||
+ assert(thd_killed(NULL) || !active_tranxs_ ||
!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name,
trx_wait_binlog_pos));