Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Sep 14, 2023
1 parent 907ebd2 commit 4fc1586
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/mcs/scheduling/server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (c *Cluster) UpdateRegionsLabelLevelStats(regions []*core.RegionInfo) {
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) {
if store := c.GetStore(p.GetStoreId()); store != nil && !core.IsStoreContainLabel(store.GetMeta(), key, value) {
stores = append(stores, store)
}
}
Expand Down
3 changes: 2 additions & 1 deletion server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,8 @@ func (s *GrpcServer) StoreHeartbeat(ctx context.Context, request *pdpb.StoreHear

func (s *GrpcServer) updateSchedulingClient(ctx context.Context) {
forwardedHost, _ := s.GetServicePrimaryAddr(ctx, utils.SchedulingServiceName)
if forwardedHost != "" && forwardedHost != s.schedulingClient.Load().(*schedulingClient).getPrimaryAddr() {
pre := s.schedulingClient.Load()
if forwardedHost != "" && (pre != nil && forwardedHost != pre.(*schedulingClient).getPrimaryAddr()) {
client, err := s.getDelegateClient(ctx, forwardedHost)
if err != nil {
log.Error("get delegate client failed", zap.Error(err))
Expand Down

0 comments on commit 4fc1586

Please sign in to comment.