Skip to content

Conversation

dveeden
Copy link
Collaborator

@dveeden dveeden commented Nov 8, 2024

Issue: close #944

For go-mysqlbinlog and go-canal: return an error for invalid flavors.

For go-mysqlbinlog: log a non-critical error if the server version has "MariaDB" in it but the flavor isn't set to "mariadb".

@dveeden
Copy link
Collaborator Author

dveeden commented Nov 8, 2024

If there is an good way to make it auto detect the flavor this would be even better

Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

serverVersion := b.c.GetServerVersion()
if b.cfg.Flavor != MariaDBFlavor &&
strings.Contains(b.c.GetServerVersion(), "MariaDB") {
b.cfg.Logger.Errorf("misconfigured flavor (%s) for server %s",
Copy link
Collaborator

Choose a reason for hiding this comment

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

And I think we can add comment to explain why this is only a log not a failure to caller, like "MariaDB still sends binlog events in a compatible way although some functionalities are lost, so we just log the problem"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added a code comment. Or did you want to put this in the message instead?

For `go-mysqlbinlog` and `go-canal`: return an error for invalid
flavors.

For `go-mysqlbinlog`: log a non-critical error if the server version has "MariaDB"
in it but the flavor isn't set to "mariadb".
@lance6716 lance6716 merged commit 8b76415 into go-mysql-org:master Nov 20, 2024
13 checks passed
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.

go-mysqlbinlog: wrong positions for events and Gtid events get decoded as QueryEvent

2 participants