Fix for FullStatus gRPC connection pooling#15520
Fix for FullStatus gRPC connection pooling#15520GuptaManan100 wants to merge 14 commits intovitessio:mainfrom
Conversation
Signed-off-by: Manan Gupta <manan@planetscale.com>
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 <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
| if _, ok := status.FromError(err); !ok { | ||
| // Not a gRPC error | ||
| return | ||
| } |
There was a problem hiding this comment.
@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 <manan@planetscale.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
…le/vitess into full-status-connection-pooling Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
|
@GuptaManan100 as @dbussink points out, adding the |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
| if err != nil { | ||
| if invalidator != nil { | ||
| invalidator(err) | ||
| } | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
nit: can remove passing error to invalidator
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
|
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
rpcClientMapcaches 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, thenrpcClientMapmakes 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