Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
Signed-off-by: rleungx <[email protected]>
  • Loading branch information
rleungx committed Feb 21, 2019
1 parent 85cff76 commit 1d36398
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions server/heartbeat_streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ func (s *heartbeatStreams) run() {
storeID := msg.GetTargetPeer().GetStoreId()
store, err := s.cluster.GetStore(storeID)
if err != nil {
log.Errorf("[region %v] fail to get store %v: %v", msg.RegionId, storeID, err)
log.Error("fail to get store",
zap.Uint64("region-id", msg.RegionId),
zap.Uint64("store-id", storeID),
zap.Error(err))
delete(s.streams, storeID)
continue
}
Expand All @@ -96,14 +99,16 @@ func (s *heartbeatStreams) run() {
regionHeartbeatCounter.WithLabelValues(storeAddress, "push", "ok").Inc()
}
} else {
log.Debug("heartbeat stream not found, skip send message", zap.Uint64("region-id", msg.RegionId), zap.Uint64("store-id", storeID))
log.Debug("heartbeat stream not found, skip send message",
zap.Uint64("region-id", msg.RegionId),
zap.Uint64("store-id", storeID))
regionHeartbeatCounter.WithLabelValues(storeAddress, "push", "skip").Inc()
}
case <-keepAliveTicker.C:
for storeID, stream := range s.streams {
store, err := s.cluster.GetStore(storeID)
if err != nil {
log.Errorf("[store %v] fail to get store: %v", storeID, err)
log.Error("fail to get store", zap.Uint64("store-id", storeID), zap.Error(err))
delete(s.streams, storeID)
continue
}
Expand Down

0 comments on commit 1d36398

Please sign in to comment.