Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 10.0.19
-
Fix Version/s: 10.0.21
-
Component/s: Replication
-
Labels:None
-
Environment:CentOS 6.x Linux
Description
In a two level replication setup that had originally been running with binlog_checksum=NONE enabling binlog_checksum=CRC32 DDL statements executed on the primary master caused SQL execution errors on 2nd level slaves, but not the intermediate master.
DDL statements (seen on CREATE TABLE and ALTER TABLE) failed as there were extra random characters added at the end of the SQL statement text.
Looking at the failing statement with "mysqlbinlog --hexdump" showed that in addition to the expected four checksum bytes (as seen in the binlog event header) four additional bytes had been added between the end of the statement and the checksum bytes.
So it looks as if the intermediate master somehow added a 2nd CRC32 checksum to these events instead of replacing it with a new checksum of its own.
Only DDL statements were affected, probably as only these are replicated as SQL text in ROW format.
Binlog configuration settings were (after binlog checksums were activated):
log-bin = ../log/binlog binlog_format = ROW sync_binlog = 1 expire_logs_days = 7 log_slave_updates max_binlog_size = 100M binlog_checksum = CRC32 binlog_ignre_db = ...one database that was not related to the failing statements ... relay_log = ../log/relaylog max_relay_log_size = 100M slave_compressed_protocol = OFF
The failure only occurred in production and could not be reproduced in a local test setup yet ...
Gliffy Diagrams
Attachments
Issue Links
- blocks
-
MDEV-8429 Change binlog_checksum default to match MySQL 5.6.6+
-
- Open
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
The actual problem seems to be with "CREATE TABLE ... SELECT" ...
I can reproduce this with three servers
and minimalistic configuration
by executing this on the master:
2nd level slave fails with
Last_SQL_Errno: 1064 Last_SQL_Error: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?' at line 3' on query. Default database: 'test'. Query: 'CREATE TABLE `t2` ( `id` int(11) NOT NULL )ˠ�'In the master binlog the CREATE event for t2 looks like this:
In the intermediate slaves relay log it looks the same (same content and checksum), the only difference is the position within the relay log file (as expected)
In the intermediate slaves binlog on the other hand:
So there we see four extra bytes between the CREATE statement and the checksum bytes, but these are not the original checksum bytes from the upstream binlog event ...