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

Seconds_behind_master incorrect in parallel replication

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.7
    • 10.0.9
    • None
    • 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

            knielsen Kristian Nielsen
            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.