From e74c7a9a2a4d8aacd0a85fea65d1a33e7de10e19 Mon Sep 17 00:00:00 2001 From: Luffbee Date: Wed, 21 Aug 2019 21:13:12 +0800 Subject: [PATCH] add logs for debug --- server/schedulers/hot_region.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/schedulers/hot_region.go b/server/schedulers/hot_region.go index f76041a7c90..02f9cd31b79 100644 --- a/server/schedulers/hot_region.go +++ b/server/schedulers/hot_region.go @@ -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 } @@ -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 } @@ -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 }