List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:November 1 2009 4:35am
Subject:bzr commit into mysql-5.1-rep-semisync branch (zhenxing.he:3123)
View as plain text  
#At file:///media/sdb2/hezx/work/mysql/bzrwork/semisync/5.1-rep-semisync/ based on revid:zhenxing.he@stripped

 3123 He Zhenxing	2009-11-01
      Use set_timespec_nsec to calculate the wait time for semi-sync
     @ plugin/semisync/semisync_master.cc
        Use set_timespec_nsec to calculate the wait time for semi-sync

    M  plugin/semisync/semisync_master.cc
=== modified file 'plugin/semisync/semisync_master.cc'
--- a/plugin/semisync/semisync_master.cc	2009-10-23 04:56:30 +0000
+++ b/plugin/semisync/semisync_master.cc	2009-11-01 04:35:16 +0000
@@ -668,6 +668,7 @@ int ReplSemiSyncMaster::commitTrx(const 
     const char *old_msg= 0;
 
     start_time_err = gettimeofday(&start_tv, 0);
+    set_timespec_nsec(abstime, wait_timeout_ * TIME_MILLION);
 
     /* Acquire the mutex. */
     lock();
@@ -737,30 +738,6 @@ int ReplSemiSyncMaster::commitTrx(const 
 
       if (start_time_err == 0)
       {
-        int diff_usecs = start_tv.tv_usec + wait_timeout_ * TIME_THOUSAND;
-
-        /* Calcuate the waiting period. */
-#ifdef __WIN__
-        abstime.tv.i64 = (__int64)start_tv.tv_sec * TIME_MILLION * 10;
-        abstime.tv.i64 += (__int64)diff_usecs * 10;
-        abstime.max_timeout_msec= (long)wait_timeout_;
-#else
-        abstime.tv_sec = start_tv.tv_sec;
-        if (diff_usecs < TIME_MILLION)
-	{
-          abstime.tv_nsec = diff_usecs * TIME_THOUSAND;
-        }
-	else
-	{
-          while (diff_usecs >= TIME_MILLION)
-	  {
-            abstime.tv_sec++;
-            diff_usecs -= TIME_MILLION;
-          }
-          abstime.tv_nsec = diff_usecs * TIME_THOUSAND;
-        }
-#endif /* __WIN__ */
-
         /* In semi-synchronous replication, we wait until the binlog-dump
          * thread has received the reply on the relevant binlog segment from the
          * replication slave.


Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20091101043516-zu0o6ymwjd1roes6.bundle
Thread
bzr commit into mysql-5.1-rep-semisync branch (zhenxing.he:3123) He Zhenxing1 Nov