-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
VReplication: Use MariaDB Compat JSON Functions #12420
VReplication: Use MariaDB Compat JSON Functions #12420
Conversation
This is needed to better support importing from MariaDB into Vitess/MySQL. Signed-off-by: Matt Lord <mattalord@gmail.com>
The OnlineDDL VReplication test failures are a known unrelated issue that is being worked on. |
@mattlord Is this something we could relatively easily test in the MariaDB migration job that we have? That it also tests a vdiff both ways? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I double checked... we do already do this today:
What wouldn't have worked on the reverse workflow is the auto retry on error (because the query used to find VDiffs that should be retried failed due to the invalid syntax). But you could still manually [re]start the workflow:
Or of course you could run another VDiff, which is what you always had to do with VDiff1 if you encountered an error. So again, I think in practice this is a pretty minor issue but again, one that I think is still definitely worth doing. If we do at some point decide that it's worth adding a VDiff2 auto retry test specifically with MariaDB, then we could effectively duplicate this test: https://github.com/vitessio/vitess/blob/main/go/test/endtoend/vreplication/vdiff2_test.go#L102 And use MariaDB for the keyspaces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
This is needed to better support importing from MariaDB to Vitess/MySQL as we leverage MySQL's JSON support more and more in VReplication.
While we do not fully support MariaDB in Vitess v16 and later (where VDiff2 is GA and the default), we DO want to support easy and reliable imports from MariaDB to Vitess and MySQL. This is also a pretty easy and straightforward fix — as
col1->>'$.field1'
is equivalent toJSON_UNQUOTE(JSON_EXTRACT(col1, '$.field1'))
— and doing so allows us to fully support VDiff2 with MariaDB imports, even when running the VDiffs against the reverse workflows afterSwitchTraffic
is done (which are then executed on the source MariaDB instance).Related Issue(s)
Checklist