-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Topo lookup tablet type #18777
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
base: main
Are you sure you want to change the base?
Topo lookup tablet type #18777
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
|
Signed-off-by: Stephen Baker <[email protected]>
Signed-off-by: Stephen Baker <[email protected]>
79a26cd to
4cfab07
Compare
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.
A few comments.
| log.Infof("Found existing tablet record with --init-tablet-type-lookup enabled, using tablet type %v from topology instead of init-tablet-type %v", | ||
| existingTablet.Type, tablet.Type) | ||
| tablet.Type = existingTablet.Type | ||
| // If it was a PRIMARY, preserve the start time |
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.
Do we want to preserve tablet type PRIMARY? Imagine this:
- vttablet is running as Primary.
- vttablet crashes.
- vtorc fails-over.
- vttablet gets restarted by systemd.
- vttablet restores its tablet type to Primary, but there is already a primary set by vtorc.
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.
had initially thought the checkPrimaryShip() would handle any conflicts, but seems like it wouldn't revert the tablet back to REPLICA.
added special handling for type detected previously as PRIMARY to be set to REPLICA, allowing checkPrimaryShip() to set back to PRIMARY if appropriate.
f2eb9b8
Signed-off-by: Stephen Baker <[email protected]>
Description
This adds an optional
--init_tablet_type_lookupstartup flag forvttabletto implement functionality described in this issue.When present,
--init_tablet_type_lookupwill result in searching the topology for the current tablet being started. If found, will use the previous tablet type instead of the one passed with--init_tablet_type.Related Issue(s)
Feature Request: Add ability to restore TabletType on restart based on topology.
Checklist
Deployment Notes
AI Disclosure