-
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
Change GRPC message limit SQL error type #6630
Merged
harshit-gangal
merged 14 commits into
vitessio:master
from
tinyspeck:sa-demux-resource-exhausted
Sep 17, 2020
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b7ee93c
impl+log
setassociative 5c6f28c
correctly escape regex
setassociative 191059f
simple tests, remove logging
setassociative a4b6678
years are dumb
setassociative 7eca1d0
handle the other tow RE cases.
setassociative c8bf350
fix up comments, move impls around
setassociative 1ca9189
better better error comment <_<
setassociative 8fabb36
assert!
setassociative de4841b
to run test suite
setassociative b3016f3
fix up testsv
setassociative 439e78a
tests pass; remove dead code-as-comments
setassociative d80cd71
Merge branch 'master' into sa-demux-resource-exhausted
setassociative cc789c9
pull out unnecessary processing
setassociative f67cf52
don't differentiate trailing vs leading clarification
setassociative 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Copyright 2020 The Vitess Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package mysql | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestDumuxResourceExhaustedErrors(t *testing.T) { | ||
type testCase struct { | ||
msg string | ||
want int | ||
} | ||
|
||
cases := []testCase{ | ||
testCase{"misc", ERTooManyUserConnections}, | ||
testCase{"grpc: received message larger than max (99282 vs. 1234): trailer", ERNetPacketTooLarge}, | ||
testCase{"grpc: received message larger than max (1234 vs. 1234)", ERNetPacketTooLarge}, | ||
testCase{"header: grpc: received message larger than max (1234 vs. 1234)", ERNetPacketTooLarge}, | ||
// This should be explicitly handled by returning ERNetPacketTooLarge from the execturo directly | ||
// and therefore shouldn't need to be teased out of another error. | ||
testCase{"in-memory row count exceeded allowed limit of 13", ERTooManyUserConnections}, | ||
} | ||
|
||
for _, c := range cases { | ||
got := demuxResourceExhaustedErrors(c.msg) | ||
assert.Equalf(t, c.want, got, c.msg) | ||
} | ||
} |
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
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
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
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
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.
is this still required after changing to through mysql error directly?
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.
Yes -- if we directly map all ResourceExhausted into ERNetPacketTooLarge then we end up in the same position where we are grouping errors that don't necessarily make sense together.
Specifically when we overflow a connection pool (
vttablet: rpc error: code = ResourceExhausted desc = pool ConnPool waiter count exceeded
) and the like we want to distinguish that as something that can be solved via backoff (ResourceExhausted) instead of queries that are inherently less retryable because they are likely to generate "bad" data (ErNetPacketTooLarge).