-
Notifications
You must be signed in to change notification settings - Fork 728
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
client/router: implement the query region gRPC client #8939
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8e258ea
to
292cdf2
Compare
924a13a
to
a55a818
Compare
59c7dbe
to
48ff881
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8939 +/- ##
==========================================
- Coverage 76.25% 76.21% -0.05%
==========================================
Files 466 468 +2
Lines 70733 71087 +354
==========================================
+ Hits 53938 54176 +238
- Misses 13437 13525 +88
- Partials 3358 3386 +28
Flags with carried forward coverage won't be shown. Click here to find out more. |
4b253eb
to
46fd376
Compare
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
46fd376
to
a64c5fe
Compare
Signed-off-by: JmPotato <[email protected]>
option: option, | ||
conCtxMgr: cctx.NewManager[pdpb.PD_QueryRegionClient](), | ||
updateConnectionCh: make(chan struct{}, 1), | ||
bo: retry.InitialBackoffer( |
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.
need to update
// Before Go 1.23, the only safe way to use Reset was to call Timer.Stop and explicitly drain the timer first. | ||
// We need be careful here, see more details in the comments of Timer.Reset. | ||
// https://pkg.go.dev/time@master#Timer.Reset | ||
func SafeResetTimer(t *time.Timer, d time.Duration) { |
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.
We no longer need it.
leaderURL atomic.Value | ||
// conCtxMgr is used to store the context of the router stream connection(s). | ||
conCtxMgr *cctx.Manager[pdpb.PD_QueryRegionClient] | ||
// updateConnectionCh is used to trigger the connection update actively. |
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.
Should updateConnectionCh be part of conCtxMgr?
@@ -36,6 +36,7 @@ import ( | |||
"github.com/stretchr/testify/suite" | |||
clientv3 "go.etcd.io/etcd/client/v3" | |||
"go.uber.org/goleak" | |||
"golang.org/x/exp/rand" |
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.
Shall we use math/rand
?
requestCtx context.Context | ||
clientCtx context.Context | ||
|
||
key []byte |
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.
Do we need to add some comments here, since the three fields represent three different requests? They cannot have values for a single request.
What problem does this PR solve?
Issue Number: ref #8690.
What is changed and how does it work?
Check List
Tests
Release note