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

Seconds_behind_master incorrect in parallel replication

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • 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.

        Attachments

          Activity

            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:

                Git Integration

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