-
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
Return SourceAlias
in FullStatus
RPC, use to optimize VTOrc
#17843
base: main
Are you sure you want to change the base?
Return SourceAlias
in FullStatus
RPC, use to optimize VTOrc
#17843
Conversation
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17843 +/- ##
=======================================
Coverage 67.44% 67.44%
=======================================
Files 1592 1592
Lines 258173 258252 +79
=======================================
+ Hits 174126 174189 +63
- Misses 84047 84063 +16 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
186ad4a
to
f8330d4
Compare
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.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.
I have one concern in this PR. Its regarding the atomicity of the change of sourceAlias
with the mysql fields. Let's say we call SetReplicationSource
and it fails at some point. How do we guarantee there is no drift between the source set in the mysql instances and the source alias we store.
If the mysql is incorrect, but sourceAlias has been set to the correct value, will this change make VTOrc not notice that the replication needs to be fixed?
// sourceAlias is the current replication source. | ||
sourceAlias *topodatapb.TabletAlias | ||
|
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.
We need to set these field in a few more places like initializeReplication
and reset it in disableReplication
// Store the current primary alias | ||
tm.sourceAlias = parentAlias | ||
|
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.
maybe clear this in defer if the function fails 🤔
@GuptaManan100 I agree, it sounded like only a few places needed this change but the areas keep growing. I think I'd feel more confident if there were unit tests for this code, and perhaps I should start there - that way we could prove the transitions worked It doesn't change the problem much, but would the |
Sorry, I didn't respond to this specific point earlier. I wonder this too. For now I've placed the setting of the new value at the very end of funcs when we are about to |
Description
This PR implements the change described in #17297
TL;DR:
FullStatus
RPCs now include the tablet-alias of the replication source (not just the hostname/port). This alias is probably useful in general, but for now VTOrc uses it to avoid an sqlite table-scan ininst.ReadInstanceClusterAttributes
, which is a hot-path functionIn internal testing we saw a large performance win by adding an index to that
hostname, port
read - this PR should be even better because it uses primary key reads and no additional index, becausealias
is the PKRelated Issue(s)
Closes #17297
Checklist
Deployment Notes