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

replication,cmd: improve flavor handling #946

Merged
merged 2 commits into from
Nov 20, 2024

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

replication/binlogsyncer.go Show resolved Hide resolved
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