-
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
Fix for FullStatus gRPC connection pooling #15520
Fix for FullStatus gRPC connection pooling #15520
Conversation
Signed-off-by: Manan Gupta <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15520 +/- ##
==========================================
- Coverage 67.41% 65.72% -1.70%
==========================================
Files 1560 1560
Lines 192752 194594 +1842
==========================================
- Hits 129952 127893 -2059
- Misses 62800 66701 +3901 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
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.
Rest LGTM
if _, ok := status.FromError(err); !ok { | ||
// Not a gRPC error | ||
return | ||
} |
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.
@harshit-gangal Would some error codes from MySQL also pass this check and end up causing us to invalidate the grpc connection?
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
…le/vitess into full-status-connection-pooling Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
@GuptaManan100 as @dbussink points out, adding the |
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
if err != nil { | ||
if invalidator != nil { | ||
invalidator(err) | ||
} | ||
return nil, err | ||
} |
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.
nit: can remove passing error
to invalidator
Signed-off-by: Shlomi Noach <[email protected]>
A different implementation in #15562 . |
Description
Fixes a bug in
TabletManagerClient
's pool dialer. In:vitess/go/vt/vttablet/grpctmclient/client.go
Lines 163 to 170 in 8833092
rpcClientMap
caches tablet connections indefinitely based on address. If a tablet goes down, it does not get evicted from the map. If a new tablet then bootstraps with the same address, thenrpcClientMap
makes us continuously try connecting to that tablet, even if it's on another cluster.The solution is to evict a tablet/connection from the map upon connection/gRPC error.
However, since said error is seen long after we've returned the cached client / dialer, the user of the client needs to proactively invalidate the cached connection. To that effect, we now return an
invalidator()
function that can invalidate a cached connection based on the returned error.Related Issue(s)
poolDialer
#15563Checklist
Deployment Notes