[MDEV-12290] Wrong timestamps in binary log causes replication issues Created: 2017-03-17 Updated: 2017-09-21 Resolved: 2017-05-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.0, 10.1, 10.2.4, 10.2 |
| Fix Version/s: | 10.2.6 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Guillaume Lefranc | Assignee: | Sachin Setiya (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | 10.2-ga | ||
| Attachments: |
|
| Description |
|
I have configured a MariaDB 10.2.4 GTID Slave with master_delay=3600, and it seems to cause replication to lag behind more and more. Waits trigger even though Seconds_Behind_Master is > 3600.
|
| Comments |
| Comment by Elena Stepanova [ 2017-03-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you please paste or attach a few consequent slave status outputs, to see the dynamics, including Read_Master_Log_Pos and Exec_Master_Log_Pos (or just the full output). | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Guillaume Lefranc [ 2017-03-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
The cnf files are unaltered defaults. I forgot to mention that the master is a 10.1 MariaDB, but the manual doesn't mention incompatibility. Will try to gather more info/write a reproduceable test case. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Guillaume Lefranc [ 2017-03-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
In the example below, even I am really far behind the master, SQL_Delay still triggers.
| |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Guillaume Lefranc [ 2017-03-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
OK, I think I've got something. If I look at the binary log entry where the delay is triggered (this entry is one of the first after binlog rotation) here is what I get:
The timestamp of binlog entry 10497 seems completely wrong at "700101 1:00:00" (Unix time anyone?) So, at each binlog rotation and/or binlog checkpoint, my slave gets an additional N seconds of delay... | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Guillaume Lefranc [ 2017-03-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Before you ask, the time of my servers is in sync. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-03-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Great catch, thanks. plinux, so, the problem is two-fold. The timestamp obviously needs to be fixed in all 10.x versions; but also, we need to somehow make sure that 10.2 is able to replicate even from older 10.0/10.1 versions, before the timestamp fix. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2017-05-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi tanj And run lacs of (insert )query on server 1 , with after every 10 insert there was flush logs | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2017-05-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Doesn't the set_time() need to go inside the loop, before the call to But nice catch, good to get this fixed. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2017-05-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi knielsen, Patch updated | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marcus Zambrano [ 2017-09-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
I am experiencing this issue when attaching a 10.2.8 Slave to a 10.0.24 Master. At every #700101 Binlog checkpoint event, the SQL Delay counter is reapplied and the Slave is continually delayed. master# mysql -e 'select @@version;'
-----------------
----------------- master# mysqlbinlog bin-log.023901 | grep ^#700 slave# mysql -e 'select @@version;'
--------------------
-------------------- Seconds_Behind_Master: 2170 Even if the Master is upgraded to 10.0.32 (latest), the bogus timestamps will still be present - as confirmed in a sandbox:
| |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2017-09-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi zam1081! This patched was pushed only to 10.2, I have back-ported this patch to 10.0 , by this merge this will also be available to 10.1.
|