Skip to content

Commit

Permalink
cluster/processRegionHeartbeat:print down peer when the related store…
Browse files Browse the repository at this point in the history
… is not disconnected

Signed-off-by: Shirly <AndreMouche@126.com>
  • Loading branch information
AndreMouche committed Apr 9, 2024
1 parent 3475fe5 commit af8bdd3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,19 @@ func (c *RaftCluster) processRegionHeartbeat(region *core.RegionInfo, tracer cor
cluster.HandleStatsAsync(c, region)
}
tracer.OnAsyncHotStatsFinished()
// log down peers when the related store is not disconnected.
for _, p := range region.GetDownPeers() {
store := c.GetStore(p.Peer.StoreId)
if store != nil && !store.IsDisconnected() {
log.Warn("region has down peer on connected store",
zap.Uint64("region-id", region.GetID()),
zap.Uint64("store-id", p.Peer.StoreId),
zap.String("store last heartbeat ts", store.GetLastHeartbeatTS().Format(time.UnixDate)),
zap.Uint64("down-peer", p.Peer.Id),
zap.Uint64("down seconds", p.DownSeconds))
}
}

hasRegionStats := c.regionStats != nil
// Save to storage if meta is updated, except for flashback.
// Save to cache if meta or leader is updated, or contains any down/pending peer.
Expand Down

0 comments on commit af8bdd3

Please sign in to comment.