-
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
mcs: forward store requests to scheduling server #6976
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Skipping CI for Draft Pull Request. |
// ignore the error | ||
return &pdpb.StoreHeartbeatResponse{}, nil | ||
} | ||
|
||
// ignore the 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.
Maybe we should have a counter to record the error here.
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.
add TODO here
@@ -979,6 +998,18 @@ func (s *GrpcServer) StoreHeartbeat(ctx context.Context, request *pdpb.StoreHear | |||
|
|||
s.handleDamagedStore(request.GetStats()) | |||
|
|||
if s.IsAPIServiceMode() { |
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 possible to extract this logic to use a common function so that we could reuse it at line 862 as well?
5f91e06
to
4e0c0e1
Compare
200a944
to
9a30a83
Compare
Codecov Report
@@ Coverage Diff @@
## master #6976 +/- ##
==========================================
- Coverage 74.45% 74.35% -0.11%
==========================================
Files 437 437
Lines 46533 46612 +79
==========================================
+ Hits 34648 34659 +11
- Misses 8840 8901 +61
- Partials 3045 3052 +7
Flags with carried forward coverage won't be shown. Click here to find out more. |
97e5d21
to
0579b2a
Compare
958aa0d
to
30892d0
Compare
a2d01bd
to
d47f5d2
Compare
server/grpc_service.go
Outdated
}, | ||
Stats: request.GetStats(), | ||
} | ||
schedulingpb.NewSchedulingClient(client).StoreHeartbeat(ctx, req) |
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 possible to reuse the same client rather than create one each time?
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
9783afc
to
d9a6c94
Compare
Signed-off-by: Ryan Leung <rleungx@gmail.com>
d9a6c94
to
907ebd2
Compare
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 rest LGTM
pkg/mcs/scheduling/server/cluster.go
Outdated
func (c *Cluster) getStoresWithoutLabelLocked(region *core.RegionInfo, key, value string) []*core.StoreInfo { | ||
stores := make([]*core.StoreInfo, 0, len(region.GetPeers())) | ||
for _, p := range region.GetPeers() { | ||
if store := c.GetStore(p.StoreId); store != nil && !core.IsStoreContainLabel(store.GetMeta(), key, value) { |
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.
if store := c.GetStore(p.StoreId); store != nil && !core.IsStoreContainLabel(store.GetMeta(), key, value) { | |
if store := c.GetStore(p.GetStoreId()); store != nil && !core.IsStoreContainLabel(store.GetMeta(), key, value) { |
} | ||
|
||
// HandleStoreHeartbeat updates the store status. | ||
func (c *Cluster) HandleStoreHeartbeat(heartbeat *schedulingpb.StoreHeartbeatRequest) 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.
It is too similar to the original HandleStoreHeartbeat
, we can add some abstract functions for them?
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.
good idea, I will do it in the next PR.
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
/merge |
@rleungx: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 22945ac
|
ref tikv#5839 Signed-off-by: Ryan Leung <rleungx@gmail.com>
What problem does this PR solve?
Issue Number: Ref #5839.
What is changed and how does it work?
This PR implements the basic functionality for synchronizing the store info.
Need to merge pingcap/kvproto#1183 first.
Check List
Tests
Release note