Skip to content

Commit

Permalink
add logs for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Luffbee committed Aug 21, 2019
1 parent 63a91f9 commit e74c7a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/schedulers/hot_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,13 @@ func calcScore(cluster schedule.Cluster, pendingInf opInfluence, typ BalanceType
// balanceByPeer balances the peer distribution of hot regions.
func (h *balanceHotRegionsScheduler) balanceByPeer(cluster schedule.Cluster, storesStat statistics.StoreHotRegionsStat) (*core.RegionInfo, *metapb.Peer, *metapb.Peer, map[uint64]float64) {
if !h.allowBalanceRegion(cluster) {
log.Info("hotspot scheduler balance by peer: not allowed balance region")
return nil, nil, nil, nil
}

srcStoreID := h.selectSrcStore(storesStat)
if srcStoreID == 0 {
log.Info("hotspot scheduler balance by peer: source store not found", zap.Uint64("store-id", srcStoreID))
return nil, nil, nil, nil
}

Expand Down Expand Up @@ -462,6 +464,7 @@ func (h *balanceHotRegionsScheduler) balanceByPeer(cluster schedule.Cluster, sto

srcPeer := srcRegion.GetStorePeer(srcStoreID)
if srcPeer == nil {
log.Info("hotspot scheduler balance by peer: source peer not found", zap.Uint64("region id", srcRegion.GetID()), zap.Uint64("store id", srcStoreID))
return nil, nil, nil, nil
}

Expand All @@ -478,10 +481,12 @@ func (h *balanceHotRegionsScheduler) balanceByPeer(cluster schedule.Cluster, sto
destPeer.GetStoreId(): float64(rs.GetFlowBytes()),
}

log.Info("hotspot scheduler balance by peer: success")
return srcRegion, srcPeer, destPeer, influence
}
}

log.Info("hotspot scheduler balance by peer: no available hot region")
return nil, nil, nil, nil
}

Expand Down

0 comments on commit e74c7a9

Please sign in to comment.