-
Notifications
You must be signed in to change notification settings - Fork 2.3k
EmergencyReparentShard: support reachable replica tablets w/mysqld down
#18896
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
Draft
timvaillancourt
wants to merge
22
commits into
vitessio:main
Choose a base branch
from
timvaillancourt:ers-handle-mysqld-down
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
df57f95
improve `TestGRPCErrorCode_UNAVAILABLE` test
timvaillancourt 29d03c0
support `UNAVAILABLE` errors on `.ReplicationStatus`
timvaillancourt 2abbc8a
rename test
timvaillancourt 97e8683
cleanup
timvaillancourt ee68e21
cleanup
timvaillancourt 032fd6e
fix test, add comment
timvaillancourt c27ec8b
fix comment
timvaillancourt f7f87fe
improve test
timvaillancourt 5231f76
improve test
timvaillancourt 14883c7
code cleaning
timvaillancourt 62a26fe
rm dupe error mapping
timvaillancourt 8bf456b
revert
timvaillancourt 85d31ce
check vtctld version instead
timvaillancourt 358daac
fix test typo, add topo.IsReplicaType()
timvaillancourt ceb2cb9
fix test typo, add topo.IsReplicaType()
timvaillancourt 19996f8
make .RunSQL more resilient to slow mysqld
timvaillancourt 34d9f24
typo
timvaillancourt 9c3350c
fix comment
timvaillancourt 08835b6
Update go/test/endtoend/reparent/emergencyreparent/ers_test.go
timvaillancourt 9746e97
Merge remote-tracking branch 'origin/main' into ers-handle-mysqld-down
timvaillancourt 7dbc44b
use `t.Context()`
timvaillancourt 034d040
Revert "make .RunSQL more resilient to slow mysqld"
timvaillancourt 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,16 +32,15 @@ import ( | |
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
|
|
||
| querypb "vitess.io/vitess/go/vt/proto/query" | ||
| "vitess.io/vitess/go/vt/utils" | ||
| "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" | ||
| "vitess.io/vitess/go/vt/vttablet/tabletconn" | ||
|
|
||
| "vitess.io/vitess/go/mysql" | ||
| "vitess.io/vitess/go/sqltypes" | ||
| "vitess.io/vitess/go/test/endtoend/cluster" | ||
| "vitess.io/vitess/go/vt/log" | ||
| querypb "vitess.io/vitess/go/vt/proto/query" | ||
| topodatapb "vitess.io/vitess/go/vt/proto/topodata" | ||
| "vitess.io/vitess/go/vt/utils" | ||
| "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" | ||
| "vitess.io/vitess/go/vt/vttablet/tabletconn" | ||
| ) | ||
|
|
||
| var ( | ||
|
|
@@ -396,7 +395,7 @@ func Ers(clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, to | |
| func ErsIgnoreTablet(clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, timeout, waitReplicasTimeout string, tabletsToIgnore []*cluster.Vttablet, preventCrossCellPromotion bool) (string, error) { | ||
| var args []string | ||
| if timeout != "" { | ||
| args = append(args, "--action_timeout", timeout) | ||
| args = append(args, "--action-timeout", timeout) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This resolves a warning because of underscore deprecation |
||
| } | ||
| args = append(args, "EmergencyReparentShard", fmt.Sprintf("%s/%s", KeyspaceName, ShardName)) | ||
| if tab != nil { | ||
|
|
@@ -575,11 +574,15 @@ func StopTablet(t *testing.T, tab *cluster.Vttablet, stopDatabase bool) { | |
| err := tab.VttabletProcess.TearDownWithTimeout(30 * time.Second) | ||
| require.NoError(t, err) | ||
| if stopDatabase { | ||
| err = tab.MysqlctlProcess.Stop() | ||
| require.NoError(t, err) | ||
| StopTabletMySQL(t, tab) | ||
| } | ||
| } | ||
|
|
||
| // StopTabletMySQL stops the database on a tablet. | ||
| func StopTabletMySQL(t *testing.T, tab *cluster.Vttablet) { | ||
| require.NoError(t, tab.MysqlctlProcess.Stop()) | ||
| } | ||
|
|
||
| // RestartTablet restarts the tablet | ||
| func RestartTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet) { | ||
| tab.MysqlctlProcess.InitMysql = false | ||
|
|
||
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.