summaryrefslogtreecommitdiff
path: root/plugin/semisync
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-03 15:22:39 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-03 15:22:39 +0100
commit72c20282db820b0b0818aea160a485bdca897eec (patch)
tree3089e022d958990fc0a405a38ba43ae00c87103c /plugin/semisync
parent5e1d5d9bc0bf9ea776bffe6c4914a84be920c0b2 (diff)
parent2acc01b3cfa27074f93016b893cda20fa0a3497f (diff)
downloadmariadb-git-72c20282db820b0b0818aea160a485bdca897eec.tar.gz
10.0-base merge
Diffstat (limited to 'plugin/semisync')
-rw-r--r--plugin/semisync/semisync_master.cc28
1 files changed, 13 insertions, 15 deletions
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index 0c84519fac0..bb9eb96f6d7 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -479,13 +479,17 @@ void ReplSemiSyncMaster::remove_slave()
lock();
rpl_semi_sync_master_clients--;
- /* If user has chosen not to wait if no semi-sync slave available
- and the last semi-sync slave exits, turn off semi-sync on master
- immediately.
- */
- if (!rpl_semi_sync_master_wait_no_slave &&
- rpl_semi_sync_master_clients == 0)
- switch_off();
+ /* Only switch off if semi-sync is enabled and is on */
+ if (getMasterEnabled() && is_on())
+ {
+ /* If user has chosen not to wait if no semi-sync slave available
+ and the last semi-sync slave exits, turn off semi-sync on master
+ immediately.
+ */
+ if (!rpl_semi_sync_master_wait_no_slave &&
+ rpl_semi_sync_master_clients == 0)
+ switch_off();
+ }
unlock();
}
@@ -884,10 +888,7 @@ int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet,
* target, do not request replies from the slave.
*/
if (!getMasterEnabled() || !is_semi_sync_slave())
- {
- sync = false;
return 0;
- }
function_enter(kWho);
@@ -895,15 +896,12 @@ int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet,
/* This is the real check inside the mutex. */
if (!getMasterEnabled())
- {
- sync = false;
- goto l_end;
- }
+ goto l_end; // sync= false at this point in time
if (is_on())
{
/* semi-sync is ON */
- sync = false; /* No sync unless a transaction is involved. */
+ /* sync= false; No sync unless a transaction is involved. */
if (reply_file_name_inited_)
{