summaryrefslogtreecommitdiff
path: root/plugin/semisync
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-09-21 10:14:42 +0200
committerSergei Golubchik <sergii@pisem.net>2013-09-21 10:14:42 +0200
commit9af177042ed0e297b8f26f2c2f8ae00b3a814a90 (patch)
tree0d8d2fab7ebeb02f3c25c00ac1543754b625bde8 /plugin/semisync
parenta6add4ff43a905cee1bfd00b2ec2d276018866ce (diff)
parent2fe0836eed16ce5809c34064893681f12c77da9f (diff)
downloadmariadb-git-9af177042ed0e297b8f26f2c2f8ae00b3a814a90.tar.gz
10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
Diffstat (limited to 'plugin/semisync')
-rw-r--r--plugin/semisync/semisync_master.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index ca25c74c8fa..b67d7b8add4 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -678,15 +678,11 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
}
/* Calcuate the waiting period. */
- unsigned long long diff_nsecs =
- start_ts.tv_nsec + (unsigned long long)wait_timeout_ * TIME_MILLION;
- abstime.tv_sec = start_ts.tv_sec;
- while (diff_nsecs >= TIME_BILLION)
- {
- abstime.tv_sec++;
- diff_nsecs -= TIME_BILLION;
- }
- abstime.tv_nsec = diff_nsecs;
+ long diff_secs = (long) (wait_timeout_ / TIME_THOUSAND);
+ long diff_nsecs = (long) ((wait_timeout_ % TIME_THOUSAND) * TIME_MILLION);
+ long nsecs = start_ts.tv_nsec + diff_nsecs;
+ abstime.tv_sec = start_ts.tv_sec + diff_secs + nsecs/TIME_BILLION;
+ abstime.tv_nsec = nsecs % TIME_BILLION;
/* In semi-synchronous replication, we wait until the binlog-dump
* thread has received the reply on the relevant binlog segment from the