-
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
Experimental: Add missing tables to globally routed list in schema tracker only if they are not already present in a VSchema #17371
base: main
Are you sure you want to change the base?
Conversation
…they are not already present in a VSchema Signed-off-by: Rohit Nayak <rohit@planetscale.com>
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
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17371 +/- ##
==========================================
+ Coverage 67.48% 67.51% +0.02%
==========================================
Files 1577 1581 +4
Lines 253424 253955 +531
==========================================
+ Hits 171033 171467 +434
- Misses 82391 82488 +97 ☔ View full report in Codecov by Sentry. |
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.
Just a nomenclature nit, otherwise looks good to me!
go/vt/vtgate/vindexes/vschema.go
Outdated
if !skipIfAlreadyGlobal { | ||
// Called when updating from schema tracking | ||
continue | ||
} |
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.
The logic is fine, but doesn't the name of the variable seem exactly opposite of what it is doing? Like we are skipping adding to the global table if is already present when skipIfAlreadyGlobal
is false? Am I misunderstanding this?
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.
You are right! I changed the name of the variable from override
to this, which changed its meaning. So I should reverse the values passed in. Will do that.
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.
Fixed
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.
if !skipIfAlreadyGlobal { | |
// Called when updating from schema tracking | |
continue | |
} | |
if skipAlreadyGlobal { | |
// Called when updating from schema tracking | |
continue | |
} |
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.
!
has to go I believe
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.
Duh, yes, thanks, needed to change this as well since I switched the logic around. Fixed and tests are now passing.
…e variable name had changed from positive to negative intent ... Signed-off-by: Rohit Nayak <rohit@planetscale.com>
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.
The issue with this approach arises when there are multiple unsharded keyspaces. This makes adding the table to global routing non-deterministic, failing to fully achieve the intended purpose of this PR.
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
You mean if there are tables of the same name in multiple unsharded keyspaces (and which are not in the VSchemas). We could collect all tables names which will be added like this (not in VSchema, but found by schema tracking) first and validate that there are no duplicates, marking ones with duplicates as ambiguous, while others get globally routed. |
Discussed with @harshit-gangal . His point is that:
Options here are:
I guess the question is what is |
Description
Follows up on the idea in #16517 by not considering tables already present in the globally routable list of tables.
Related Issue(s)
#16516
Checklist
Deployment Notes