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

Seconds_behind_master incorrect in parallel replication

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.7
    • Fix Version/s: 10.0.9
    • Component/s: None
    • Labels:
      None

      Description

      As reported by plinux on #maria:

      09:03 < plinux> We found a display bug about parallel replication. When we update one row on master, and then stop
      the updates on master, we can found Seconds_Behind_Master is still increasing on slave

      I think the problem is a race between the SQL driver thread and the worker
      threads.

      Normally, the rli->last_master_timestamp is updated in stmt_done() to the
      timestamp of an event from the master. When next_event() reaches the end of
      the relay log, it is temporarily set to 0 to mark that SQL thread is caught
      up; SHOW SLAVE STATUS handles this value special.

      But with parallel replication, it can easily happen that the SQL driver thread
      reaches the end of the relay log before a worker thread calls stmt_done(),
      thus ending up with the wrong value in rli->last_master_timestamp and hence
      wrong output of SHOW SLAVE STATUS.

        Gliffy Diagrams

          Attachments

            Activity

            Show
            knielsen Kristian Nielsen added a comment - - edited Patch for review: http://lists.askmonty.org/pipermail/commits/2014-January/005802.html
            Hide
            knielsen Kristian Nielsen added a comment -

            Fix pushed to 10.0-base and 10.0, will appear in 10.0.9.

            Show
            knielsen Kristian Nielsen added a comment - Fix pushed to 10.0-base and 10.0, will appear in 10.0.9.

              People

              • Assignee:
                knielsen Kristian Nielsen
                Reporter:
                knielsen Kristian Nielsen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: