Skip to content
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

Added binlog events from MariaDB that can be skipped #297

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions binlog_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ func (s *BinlogStreamer) Run() {
// or the end of the current/next transaction. As such, the query will be
// reset following the next RowsQueryEvent before the corresponding RowsEvent(s)
query = nil
case *replication.GenericEvent:
if ev.RawData[4] == 164 && ev.Header.Flags == replication.LOG_EVENT_IGNORABLE_F {
// This event is published in binlog when encrypt_binlog is enabled for MariaDB
// event 164 shouldn't be published to replica but actually is, as it is not relevant
// since we receive binlogs unencrypted we can skip this event
// https://mariadb.com/kb/en/start_encryption_event/
isEventPositionValid = false
}
}

if isEventPositionValid {
Expand Down