-
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
SwitchTraffic should switch everything when no tablet_types provided #10434
Merged
Conversation
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
Signed-off-by: Matt Lord <[email protected]>
mattlord
added
Type: Bug
Component: VReplication
release notes none
release notes (needs details)
This PR needs to be listed in the release notes in a dedicated section (deprecation notice, etc...)
and removed
release notes none
labels
Jun 5, 2022
mattlord
removed
the
release notes (needs details)
This PR needs to be listed in the release notes in a dedicated section (deprecation notice, etc...)
label
Jun 5, 2022
Signed-off-by: Matt Lord <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
mattlord
force-pushed
the
switch_all_traffic
branch
from
June 6, 2022 02:27
4cb388d
to
7dbbd96
Compare
Meaning that we don't explicitly specify a tablet_types value and leverage the command default which should be: in_order:RDONLY,REPLICA,PRIMARY This also requires that the tests actually create RDONLY tablets, so do that for the basic v2 workflow tests. Signed-off-by: Matt Lord <[email protected]>
mattlord
force-pushed
the
switch_all_traffic
branch
from
June 6, 2022 02:33
7dbbd96
to
8f41bcf
Compare
And test traffic switching of RDONLY tablets Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
mattlord
force-pushed
the
switch_all_traffic
branch
from
June 6, 2022 06:23
c103ad8
to
88392e2
Compare
|
||
// userPassedFlag returns true if the flag name given was provided | ||
// as a command-line argument by the user. | ||
func userPassedFlag(flags *flag.FlagSet, name string) bool { |
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.
❤️
rohit-nayak-ps
approved these changes
Jun 6, 2022
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.
lgtm
nice catch
Signed-off-by: Matt Lord <[email protected]>
Manual test to confirm fix for #10421:
|
DeathBorn
pushed a commit
to vinted/vitess
that referenced
this pull request
Apr 12, 2024
…itessio#10434) * We should switch everything when no tablet_types provided * Update help output to clarify behavior * Update SwitchTraffic [all|default] tests for user facing client behavior Meaning that we don't explicitly specify a tablet_types value and leverage the command default which should be: in_order:RDONLY,REPLICA,PRIMARY This also requires that the tests actually create RDONLY tablets, so do that for the basic v2 workflow tests. * Properly handle SwitchTraffic default And test traffic switching of RDONLY tablets * Only add RDONLY tables in default Cell Signed-off-by: Matt Lord <[email protected]> Signed-off-by: Vilius Okockis <[email protected]>
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.
Description
The default
--tablet_types
value for theSwitchTraffic
command was errantly changed in #10040 where we generally madein_order:REPLICA,PRIMARY
the default--tablet_types
value in VReplication. ForSwitchTraffic
, we should be switching traffic for all tablet types when none are specified: https://vitess.io/docs/14.0/reference/vreplication/switchtraffic/#--tablet_typesSwitchedTraffic
forRDONLY
tablets when no value was specified for--tablet_types
. That's because the flag has a default value so it was never an empty string here and the override was never applied (before or after changing what we overrode it to). From v13:vitess/go/vt/vtctl/vtctl.go
Lines 2443 to 2448 in 12fc1f0
So, in this PR we do the following:
--tablet_types
flag was passed on the command line, and if not then we use the new override to switch everything by default--tablet_flag
value was provided on the command-line when we intend to switch all trafficRDONLY
tablets and confirm that traffic for them is also switched when doingSwitchTraffic
w/o a--tablet_types
flag valueI will also update the v14 docs to the new default here of:
in_order:RDONLY,REPLICA,PRIMARY
Related Issue(s)
Checklist