Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Jan 16, 2024
1 parent 1bca504 commit 73fe9bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/schedule/prepare_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (checker *prepareChecker) check(c *core.BasicCluster, collectWaitTime ...ti
}
storeID := store.GetID()
// It is used to avoid sudden scheduling when scheduling service is just started.
if len(collectWaitTime) > 0 && float64(store.GetRegionCount())*collectFactor > float64(c.GetNotFromStorageRegionsCntByStore(storeID)) {
if len(collectWaitTime) > 0 && (float64(store.GetStoreStats().GetRegionCount())*collectFactor > float64(c.GetNotFromStorageRegionsCntByStore(storeID))) {
return false
}
// For each store, the number of active regions should be more than total region of the store * collectFactor
Expand Down
2 changes: 1 addition & 1 deletion server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ func (s *GrpcServer) RegionHeartbeat(stream pdpb.PD_RegionHeartbeatServer) error

err = rc.HandleRegionHeartbeat(region)
if err != nil {
regionHeartbeatCounter.WithLabelValues(storeAddress, storeLabel, "report", "err").Inc()
regionHeartbeatCounter.WithLabelValues(storeAddress, storeLabel, "report", "err").Inc()
msg := err.Error()
s.hbStreams.SendErr(pdpb.ErrorType_UNKNOWN, msg, request.GetLeader())
continue
Expand Down

0 comments on commit 73fe9bf

Please sign in to comment.