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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.4, 5.5.32
    • 10.0.5, 5.5.33
    • None
    • 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++;

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.