tm revamp: remove calls to refreshTablet#6263
Merged
sougou merged 6 commits intovitessio:masterfrom Jun 10, 2020
Merged
Conversation
Calls to topo.UpdateTabletFields is mostly confined to within the tabletmanager. The few left-overs are for tests and utils. There are still the old-style vtctl commands that can update the tablet record. For now, I've marked them as deprecated. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
This change removes refreshTablet from startup functions. Also, InitTablet has been changed to only update the topo. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
All internal usage of refreshTablet has been replaced with updateState, which eventually calls publishState. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Sometimes updateState may fail due to context expired. Change the logic to retry immediately with batchCtx if the original attempt failed with the request ctx. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
deepthi
reviewed
Jun 9, 2020
| _isBackupRunning bool | ||
|
|
||
| pubMu sync.Mutex | ||
| // _tablet has the Tablet record we last read from the topology server. |
Collaborator
There was a problem hiding this comment.
comment should match field name.
| // tablet's timestamp is ahead of the topo's timestamp. | ||
| agent.setMasterTermStartTime(agentMasterTermStartTime) | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
We need an else part for non-master types (to set the MasterTermStartTime to 0/nil).
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
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.
Most calls to refreshTablet have been replaced by updateState. This reverses the order in which the tablet record is updated. In the new scenario, we update the internal state of tabletmanager first, and then update the tablet record. If the update fails, we start a thread that keeps retrying until the update succeeds.
This change also removes most calls to
UpdateTabletFields. These are places that used to update the tablet record and then invoke refreshTablet.The rest of the code that reacts to change, like changeCallback, are still unchanged. We'll clean them up in subsequent PRs.