Bug #73941 binary log read from remote server are not equal when server was restarted
Submitted: 16 Sep 2014 20:54 Modified: 17 Oct 2014 13:41
Reporter: Oli Sennhauser Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.6.19 OS:Any
Assigned to: CPU Architecture:Any
Tags: binary log, mysqlbinlog

[16 Sep 2014 20:54] Oli Sennhauser
Description:
I use mysqlbinlog with remote server to stream binary logs to an other server. All the binary logs are exactly the same except the ones I get when I restart the binary log provider.

How to repeat:
mysqlbinlog --user=replication --password=secret --host=127.0.0.1 --port=35701 --read-from-remote-server --raw --stop-never binary-log.000017

restart server

Result:

Server:

ll binary-log.0*
-rw-rw---- 1 mysql mysql 9879119 Sep 16 21:16 binary-log.000016
-rw-rw---- 1 mysql mysql  964631 Sep 16 22:42 binary-log.000017
-rw-rw---- 1 mysql mysql     214 Sep 16 22:42 binary-log.000018

md5sum binary-log.0*
6edfd1a9af2f933c1bb5cacf69461b64  binary-log.000016
882da4f70c2599091758b16448d8b476  binary-log.000017
8128d60a282ab3d6df00f4c215149085  binary-log.000018

Binary Log copies:

ll binary-log.00001[4-9]
-rw-rw-r-- 1 mysql mysql 9879119 Sep 16 21:16 binary-log.000016
-rw-rw-r-- 1 mysql mysql  964583 Sep 16 22:42 binary-log.000017
-rw-rw-r-- 1 mysql mysql     214 Sep 16 22:42 binary-log.000018

md5sum binary-log.00001[4-9]
6edfd1a9af2f933c1bb5cacf69461b64  binary-log.000016
18a5ee3f287ab49271f25daeb0a6ca2b  binary-log.000017 <-- Differences!!!
8128d60a282ab3d6df00f4c215149085  binary-log.000018

This Event was too much on the original Master Binary Log or is not replicated:

# at 964583
#700101  1:00:00 server id 35701  end_log_pos 964631 CRC32 0x3ae190e1   Rotate to binary-log.000018  pos: 4

When killing or crashing the Master it works perfectly. But not with a proper shutdown.

Suggested fix:
Event should be replicated as well.
[17 Sep 2014 12:51] MySQL Verification Team
Hello Oli,

Thank you for the report.
I tried to reproduce this issue at my end but not seeing any discrepancy in the checksum. Could you please tell us how you restarted mysqlbinlog after normal shutdown on master? Also, it would be nice to know what the differences actually in the source/target binary log.

Could you please provide copy master's error log, exact steps to reproduce this issue, or confirm if the tried steps(joining the activity log shortly in 73941.txt) are missing any steps which are important to reproduce this issue?

Thanks,
Umesh
[17 Sep 2014 12:52] MySQL Verification Team
test results

Attachment: 73941.txt (text/plain), 8.51 KiB.

[17 Sep 2014 13:17] Hartmut Holzgraefe
looks as if after that "end_log_pos ... rotate to ..." has been written to the .17 file it wasn't properly flushed/closed? That would explain why it's finally fine after a process kill but not after a power loss?
[18 Oct 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".