The hole is created only with BLR_EVENT_DONE master_event_state

This fix allows the gap detection and the writing of an IGNORABLE event
only if master_event_state == BLR_EVENT_DONE.

Note: The hole is not being created if the event is bigger than 16MB
This commit is contained in:
MassimilianoPinto 2016-11-16 13:35:30 +01:00
parent 27247bea4e
commit 3b7eec8655

View File

@ -412,8 +412,8 @@ blr_write_binlog_record(ROUTER_INSTANCE *router, REP_HEADER *hdr, uint32_t size,
* Fill the gap with a self generated ignorable event
* Binlog file position is incremented by blr_write_special_event()
*/
if (hdr->next_pos && (hdr->next_pos > (file_offset + size)))
if (router->master_event_state == BLR_EVENT_DONE &&
hdr->next_pos && (hdr->next_pos > (file_offset + size)))
{
uint64_t hole_size = hdr->next_pos - file_offset - size;
if (!blr_write_special_event(router, file_offset, hole_size, hdr, BLRM_IGNORABLE))