-
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
Add tracking session state changes for transaction start #11061
Add tracking session state changes for transaction start #11061
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
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.
Woohoo! A significant performance/feasibility improvement.
One thing is that we want to think about how to specifically validate the new behavior coupled with the mysql-server
patch, in CI.
We also run a number of CI tests internally in PlanetScale and I think that that's the place where we would run against our MySQL fork as well to validate this behavior there too. |
Recap on how this is being tested: in this PR Vitess queries the MySQL server to test whether it supports This repo, The most relevant test, one that catches flaws in consistency logic, is
|
This logic depends on the custom option that PlanetScale as in it's MySQL fork to get the current committed GTID at the start of a transaction snapshot. With this GTID, we can optimize vreplication to avoid having to lock tables around vreplication operations. See planetscale/mysql-server@9fa67ec for the change in MySQL that is published in our fork. The change here allows getting back this value through any query operation that might start a transaction. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
… tables while still getting a transaction consistent GTID Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
f88af23
to
ad6989e
Compare
) (vitessio#990) * Add tracking session state changes for transaction start This logic depends on the custom option that PlanetScale as in it's MySQL fork to get the current committed GTID at the start of a transaction snapshot. With this GTID, we can optimize vreplication to avoid having to lock tables around vreplication operations. See planetscale/mysql-server@9fa67ec for the change in MySQL that is published in our fork. The change here allows getting back this value through any query operation that might start a transaction. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * Use 'session_track_gtids = START_GTID' where possible, and avoid LOCK tables while still getting a transaction consistent GTID Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Co-authored-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Co-authored-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
This logic depends on the custom option that PlanetScale as in it's MySQL fork to get the current committed GTID at the start of a transaction snapshot.
With this GTID, we can optimize vreplication to avoid having to lock tables around vreplication operations.
See planetscale/mysql-server@9fa67ec for the change in MySQL that is published in our fork.
The change here allows getting back this value through any query operation that might start a transaction.
With this change, we can essentially do what was attempted in #9991 but it will guarantee now a consistent GTID for the snapshot.
The first commit here wires up passing through the session state changes on transaction start, the second commit starts using it for VReplication.
Related Issue(s)
See #9991 for a previous failed attempt.
Checklist