Comments on: max_allowed_packet and binary log corruption in MySQL https://www.percona.com/blog/max_allowed_packet-and-binary-log-corruption-in-mysql/ Tue, 06 Feb 2024 00:34:31 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Karol Murawski https://www.percona.com/blog/max_allowed_packet-and-binary-log-corruption-in-mysql/#comment-10938924 Mon, 31 Aug 2015 10:15:09 +0000 https://www.percona.com/blog/?p=22766#comment-10938924 Another option:

if error: Got fatal error 1236 from master when reading data from binary log: ‘log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event ‘mysql-bin.000478’ at 251035246, the last event read from ‘/DATABASE/mysql/mysql-bin.000478’ at 251035246, the last byte read from ‘/DATABASE/mysql/mysql-bin.000478′ at 251035265.’

mysqlbinlog [path_to_master_file] | grep ‘[file pos]’

[file pos] – should be 251035265 but we take 251035 – we must find event before corruption

mysqlbinlog /DATABASE/mysql/mysql-bin.000478 | grep -i ‘251035’

…………
0
# at 225103579
#150831 10:44:06 server id 16777300 end_log_pos 251035064 CRC32 0x14484166 Query thread_id=23754573 exec_time=0 error_code=0
# at 251035064
#150831 10:44:06 server id 16777300 end_log_pos 251035145 CRC32 0x630bd054 Query thread_id=23754573 exec_time=0 error_code=0
# at 251035145
# at 251035177
#150831 10:44:06 server id 16777300 end_log_pos 251035177 CRC32 0x23816d86 Intvar
#150831 10:44:06 server id 16777300 end_log_pos 251035856 CRC32 0x49720f8e Query thread_id=23754573 exec_time=0 error_code=0
# at 251035856
#150831 10:44:06 server id 16777300 end_log_pos 251035938 CRC32 0x6d5fc69c Query thread_id=23754573 exec_time=0 error_code=0
# at 251035938
………

and we see that we can’t find event on position 251035246 so we take first event before corrupted postition : 251035177

than:
STOP SLAVE;
RESET SLAVE; CHANGE MASTER TO MASTER_HOST=’10.X.X.X’,MASTER_USER=’XX’,MASTER_PASSWORD=’XX’, MASTER_PORT=3306, MASTER_LOG_FILE=’mysql-bin.000478′,MASTER_LOG_POS=251035177;
START SLAVE;

]]>
By: sbester https://www.percona.com/blog/max_allowed_packet-and-binary-log-corruption-in-mysql/#comment-6727572 Sun, 18 May 2014 14:09:40 +0000 https://www.percona.com/blog/?p=22766#comment-6727572 For one genuine case, see the description of Bug #17842137 in the 5.6.16 change history…. Another commonly seen cause is incorrect positions for CHANGE MASTER, placing the slave to read in the middle of some event.

]]>