-
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
WIP: dedicated pool dialers to vtorc
and to throttler functions, no change in "concurrency"
#15560
Conversation
Signed-off-by: Manan Gupta <[email protected]>
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]>
Signed-off-by: Shlomi Noach <[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
|
Signed-off-by: Shlomi Noach <[email protected]>
// rpcClientMap maps an address to a tmc | ||
type rpcClientMap map[string](chan *tmc) | ||
|
||
// grpcClient implements both dialer and poolDialer. | ||
type grpcClient struct { | ||
// This cache of connections is to maximize QPS for ExecuteFetchAs{Dba,App}, | ||
// CheckThrottler and FullStatus. Note we'll keep the clients open and close them upon Close() only. | ||
// But that's OK because usually the tasks that use them are one-purpose only. | ||
// The map is protected by the mutex. | ||
mu sync.Mutex | ||
rpcClientMap map[string]chan *tmc | ||
mu sync.Mutex | ||
rpcClientMaps map[DialPoolGroup]rpcClientMap |
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.
DialPoolGroupThrottler
and DialPoolGroupVTOrc
do not need a channel and should only open One connection per tablet address.
better to have a different type for them and leave the other concurrent one
seperate.
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 it OK if I still make the code idential for all of them, but use channel size 1
for VTOrc and Throttler?
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.
See proposed solution in a2dd6fe
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.
CI doesn't like a2dd6fe
Signed-off-by: Shlomi Noach <[email protected]>
Yeah I messed up something here. I'm gonna create yet another final draft PR, where I keep all the existing logic, and add bespoke logic for the non-default dial groups (vtorc, throttler). |
Closing in favor of #15562 |
Description
One final alternative, this is similar to #15559, but while #15559 remvoes the so-called "concurrency" element, this PR preserves it. In this PR:
vtorc
; another, dedicated to the tablet throttler.dialPool
function returns aninvalidator
, much like Fix for FullStatus gRPC connection pooling #15520. However, onlyFullStatus
andCheckThrottler
choose to invoke it. When they do, they do not affect any other pool dialer.Related Issue(s)
#15563
Checklist
Deployment Notes