#At file:///media/sdb2/hezx/work/mysql/bzrwork/semisync/semi-sync-replication/ based on revid:zhenxing.he@stripped
8 He Zhenxing 2009-04-14
BUG#44058 Possible semi-sync replication bugs (component part)
Semi-sync master component does not set the thread's proc info,
nor set the mysys_var->current_cond/mutex, which made KILL could
not awake the thread that was waiting for the ACK, and didn't
know what the thread was waiting for.
This patch fixed the problem by calling enter_cond and exit_cond
accordingly in semi-sync master component before and after waiting
for ACK from slave.
M semisync_master.cc
=== modified file 'semisync_master.cc'
--- a/semisync_master.cc 2008-12-26 09:20:47 +0000
+++ b/semisync_master.cc 2009-04-14 05:34:44 +0000
@@ -663,12 +663,17 @@ int ReplSemiSyncMaster::commitTrx(const
struct timeval start_tv;
struct timespec abstime;
int wait_result, start_time_err;
+ const char *old_msg= 0;
start_time_err = gettimeofday(&start_tv, 0);
/* Acquire the mutex. */
lock();
+ /* This must be called after acquired the lock */
+ old_msg= current_thd_enter_cond(&COND_binlog_send_, &LOCK_binlog_,
+ "Waiting for semi-sync ACK from slave");
+
/* This is the real check inside the mutex. */
if (!getMasterEnabled())
goto l_end;
@@ -827,7 +832,9 @@ int ReplSemiSyncMaster::commitTrx(const
else
disabled_transactions_++;
- unlock();
+ /* The lock held will be released by current_thd_exit_cond, so no
+ need to call unlock() here */
+ current_thd_exit_cond(old_msg);
}
return function_exit(kWho, 0);
Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20090414053444-hhih95h0ninvp69k.bundle