-
Notifications
You must be signed in to change notification settings - Fork 745
Feat(router service): implement grpc function #9723
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
|
Skipping CI for Draft Pull Request. |
Signed-off-by: 童剑 <[email protected]>
328c657 to
67aa227
Compare
Signed-off-by: 童剑 <[email protected]>
Signed-off-by: 童剑 <[email protected]>
Signed-off-by: 童剑 <[email protected]>
Signed-off-by: 童剑 <[email protected]>
Signed-off-by: 童剑 <[email protected]>
44f7459 to
54a2392
Compare
e14be22 to
238b1b4
Compare
Signed-off-by: 童剑 <[email protected]>
238b1b4 to
9a85795
Compare
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (52.22%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #9723 +/- ##
==========================================
+ Coverage 76.82% 76.88% +0.06%
==========================================
Files 491 492 +1
Lines 78473 78504 +31
==========================================
+ Hits 60283 60354 +71
+ Misses 14486 14457 -29
+ Partials 3704 3693 -11
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/test pull-unit-test-next-gen |
| PendingPeers: region.GetPendingPeers(), | ||
| Buckets: buckets, | ||
| }, nil | ||
| request.NeedBuckets = !*followerHandle && rc.GetStoreConfig().IsEnableRegionBucket() && request.GetNeedBuckets() |
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.
How about wrap a function?
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.
The three variables from different structures, it seems so strange if a new function needs three parameters.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: okJiang 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 |
[LGTM Timeline notifier]Timeline:
|
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package grpc |
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.
Can we choose a better package name?
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.
how about move this into the pkg/utils/grpcutil/grpcutil.go?
pkg/grpc/helper.go
Outdated
| ) | ||
|
|
||
| // IncRegionRequestCounter increments the region request counter with the given method, header, error, and counter. | ||
| func IncRegionRequestCounter(method string, header *pdpb.RequestHeader, err *pdpb.Error, counter *prometheus.CounterVec) { |
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.
Suggest moving back to metrics.go
| } | ||
|
|
||
| // BatchScanRegions implements gRPC PDServer. | ||
| func BatchScanRegions(rc *core.BasicCluster, request *pdpb.BatchScanRegionsRequest, isFollower bool) (resp *pdpb.BatchScanRegionsResponse, err error) { |
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.
Seems no need to use a new package?
Signed-off-by: 童剑 <[email protected]>
|
@bufferflies: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| ) | ||
|
|
||
| // IncRegionRequestCounter increments the region request counter with the given method, header, error, and counter. | ||
| func IncRegionRequestCounter(method string, header *pdpb.RequestHeader, err *pdpb.Error, counter *prometheus.CounterVec) { |
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.
in metering?
What problem does this PR solve?
Issue Number: Ref #9212
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn:pingcap/tiup:Release note