Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4926

[PATCH] Remove division-using-subtraction implementation from semi-sync plugin

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.4, 5.5.32
    • Fix Version/s: 10.0.5, 5.5.33
    • Component/s: None
    • Labels:
      None

      Description

      Apparently the person who included our semi-sync code into MariaDB (or MySQL) assumed that semi-sync timeout will always be less than a second or on the order of a few seconds. With a very big timeout this algorithm doesn't work well.
      The following patch fixes this:

      --- a/plugin/semisync/semisync_master.cc
      +++ b/plugin/semisync/semisync_master.cc
      @@ -677,9 +677,11 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
             }
       
             /* Calcuate the waiting period. */
      +      unsigned long diff_secs = wait_timeout_ / TIME_THOUSAND;
             unsigned long long diff_nsecs =
      -        start_ts.tv_nsec + (unsigned long long)wait_timeout_ * TIME_MILLION;
      -      abstime.tv_sec = start_ts.tv_sec;
      +        start_ts.tv_nsec + (unsigned long long)wait_timeout_ * TIME_MILLION
      +                         - diff_secs * TIME_BILLION;
      +      abstime.tv_sec = start_ts.tv_sec + diff_secs;
             while (diff_nsecs >= TIME_BILLION)
             {
               abstime.tv_sec++;
      

        Gliffy Diagrams

          Attachments

            Activity

            Show
            wlad Vladislav Vaintroub added a comment - http://lists.askmonty.org/pipermail/commits/2013-September/005341.html

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                pivanof Pavel Ivanov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h