Skip to content

DBZ-2499: Debezium Connectors are failing while reading binlog: Unknown event type 100 #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

morozov
Copy link

@morozov morozov commented Oct 27, 2020

AWS Aurora writes some non-standard ignorable (LOG_EVENT_IGNORABLE_F) events of types 100 and 101 to the binlog (no documentation reference so far). If the binlog reader reads an event of an unknown type, it stops at the position right after the event type.

A subsequent call to reader.readEvent() will resume from this position and misinterpret the remaining portion of the previous event's header as a new event header. In the best case, it will return some other unknown-type event (see the test). In the worst case (if it interprets the remaining part as ROTATE), it will read the rest of the binlog in memory:

public RotateEventData deserialize(ByteArrayInputStream inputStream) throws IOException {
RotateEventData eventData = new RotateEventData();
eventData.setBinlogPosition(inputStream.readLong(8));
eventData.setBinlogFilename(inputStream.readString(inputStream.available()));
return eventData;
}

It's not clear how this issue should be solved properly since EventHeader#getType() only allows to return a value of the EventType type which by design cannot contain any non-standard values.

The proposed solution is to represent an unknown event with the UNKNOWN type and let the consumer decide how to handle it.

Copy link
Collaborator

@gunnarmorling gunnarmorling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think that's a good fix. We then can interpret EventType.UNKNOWN in Debezium as per our "event.processing.failure.handling.mode" setting.

@osheroff
Copy link
Owner

yeah this'll work for maxwell too. thx! merging.

@osheroff osheroff merged commit 9e4208c into osheroff:master Oct 29, 2020
@morozov morozov deleted the DBZ-2499 branch October 29, 2020 22:23
@xaka
Copy link

xaka commented Dec 17, 2020

@osheroff could you please apply it to maxwell by any chance? thx

@barryoneill
Copy link

@morozov I just hit this using the predecessor for this project - thank you so much for fixing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants