Using Percona 5.7 - We have setup 4 machines in a multi-master configuration. All a master and all a slave to each other.
GTID_MODE=ON & ENFORCE_GTID_CONSISTENCY=ON
Currently writes and reads are only coming in on one machine (Master1). We will be running fine for a while with all incoming transactions replicating to the other three servers (0 seconds behind master - on all slaves), and then all of the sudden replication will break on the slaves with an error like this:
'Cannot replicate anonymous transaction when AUTO_POSITION = 1, at file /data/logs/log-bin.000035, position 57764192.'
This error is on the channel coming from the Master1, so we go to Master1 and flush the logs to move to the next bin log file. Then run mysqlbinlog utility to convert binary into a readable format.
mysqlbinlog -v --base64-output=DECODE-ROWS log-bin.000035 > /data/35.txt
Then grep for the position in the file and get this:
grep -b5 57764192 /data/35.txt:
112577127-#160520 5:45:13 server id 2 end_log_pos 57764257 CRC32 0x0e4cde04 Anonymous_GTID last_committed=22371 sequence_number=22372
112577254-SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
112577297-# at 57764257
112577311-#160520 5:45:13 server id 2 end_log_pos 57764325 CRC32 0xd09bb41f Query thread_id=945041 exec_time=4294967287 error_code=0
112577437-SET TIMESTAMP=1463744713/*!*/;
Note: Server id 2 is = Master1
QUESTION:
After fixing replication and then running for a few hours again replication will break with this same error on an event coming from the Master1. With Gtid_mode=On and Enforce_Gtid_Consistency=On how are we getting anonymous transactions?
Not sure what is going on here