[MDEV-5509] Seconds_behind_master incorrect in parallel replication Created: 2014-01-07  Updated: 2014-02-10  Resolved: 2014-02-10

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.7
Fix Version/s: 10.0.9

Type: Bug Priority: Major
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
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.



 Comments   
Comment by Kristian Nielsen [ 2014-01-08 ]

Patch for review:
http://lists.askmonty.org/pipermail/commits/2014-January/005802.html

Comment by Kristian Nielsen [ 2014-02-10 ]

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

Generated at Thu Feb 08 07:04:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.