summaryrefslogtreecommitdiff
path: root/plugin/semisync
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-01-22 15:29:36 +0100
committerSergei Golubchik <sergii@pisem.net>2014-01-22 15:29:36 +0100
commit37d240ecf9213a29d6a0a236ebeb1e72c0b43ce6 (patch)
tree6bd2508d867303d8830aab0f246cd61a7ec5a835 /plugin/semisync
parente8f6f402922295ec36aab42976f3e494455407d4 (diff)
parent5caddbfd5b4a7ec377f3d40a5830436e0e6e993b (diff)
downloadmariadb-git-37d240ecf9213a29d6a0a236ebeb1e72c0b43ce6.tar.gz
MySQL-5.5.35 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 23e35c59281..625f7448945 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -478,13 +478,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();
}
@@ -883,10 +887,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);
@@ -894,15 +895,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_)
{