-
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
increase vtctlclient backupShard command success rate #14604
Merged
shlomi-noach
merged 13 commits into
vitessio:main
from
jwangace:update_method_backupShard
Nov 30, 2023
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0885dff
update_method_backupShard
7714d0a
check if stat not nil
403caad
skip checking stat of Primary
ae91011
update_method_backupShard
2b4bc65
update_method_backupShard
6da34b3
update_method_backupShard
2199317
always include TabletType_PRIMARY in returned tablets
94b9d21
create func GetBackupCandidates
d846316
update func GetBackupCandidates
ddad61a
update func GetBackupCandidates
d08edca
update func GetBackupCandidates and add func Test_GetBackupCandidates
370a3cf
Update go/vt/vtctl/reparentutil/util_test.go
jwangace e2c9a0e
update func GetBackupCandidates
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
there is a small chance that we are doing
BackupShard --allow-primary
and the shard has exactly one tablet (the primary), and this could incorrectly fail. i'd suggest:if len(tablets) < len(shardTablets)
insteadThere 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.
Hi @ajm188 do you mean that the shard is built only with 1 tablet, so it's the only 1 and primary?
if the code changed to:
In normal cases (tablets >= 2), then it should equivelant to before and does not fix the bug, becase len(tablets) < len(shardTablets) should always true when err != nil
Instead, can I suggest tablets should always include the PRIMARY and no matter it's stat nil or non-nil?
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.
ah good point.
yes, that's what i mean.
i missed that the
if len(tablets) == 0
happened inside theif err != nil
check, not outside, so i think this is a moot point. sorry for the confusion!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.
OK, given the intricate logic here I'd like to suggest extracting the logic into a separate function and adding a unit test suite to validate expected outcome of different scenarios 🙏
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 agree with Shlomi here
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.
updated PR