VReplication: permission check logic on external tablets -- switch to a more practical solution#18580
Merged
rohit-nayak-ps merged 8 commits intovitessio:mainfrom Sep 22, 2025
Conversation
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
…m CRUD on the source sidecar database Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
6c19187 to
e7a34bb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #18580 +/- ##
==========================================
- Coverage 67.53% 67.47% -0.06%
==========================================
Files 1613 1613
Lines 263780 263962 +182
==========================================
- Hits 178144 178119 -25
- Misses 85636 85843 +207 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
nickvanw
approved these changes
Aug 27, 2025
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
mattlord
reviewed
Aug 28, 2025
Member
mattlord
left a comment
There was a problem hiding this comment.
LGTM! Just the one note about error handling and logging.
Contributor
|
please merge |
…reverse-repl-perms Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
…rrors. Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
nickvanw
approved these changes
Sep 20, 2025
Collaborator
nickvanw
left a comment
There was a problem hiding this comment.
LGTM with changes, thanks for adding tests!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In #18348 we attempted to improve the logic for checking permissions on the source sidecar database. However there is one fundamental problem here that the vreplication users need permission on the mysql users table which can be a security red flag for certain users.
Another problem is that there are multiple ways of providing permissions including wild cards and role-based auth. Vitess users import from various different database versions as well, making it very hard to provide a single query to reliably test for permissions using, say just the information_schema tables.
This PR takes a different practical approach by attempting to test for permissions using dummy DMLs in a transaction to validate if permissions are present. This check is done on switching write traffic if reverse replication has been enabled.
We temporarily keep the old query around.
Related Issue(s)
#18349
Checklist
Deployment Notes