Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lhy1024 committed Apr 1, 2021
1 parent 82671c2 commit 56ad752
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@ func (c *RaftCluster) processRegionHeartbeat(region *core.RegionInfo) error {
writeItems := c.CheckWriteStatus(region)
readItems := c.CheckReadStatus(region)
c.RUnlock()
c.Lock()
if c.regionStats != nil {
c.regionStats.Observe(region, c.takeRegionStoresLocked(region))
}
c.Unlock()

// Save to storage if meta is updated.
// Save to cache if meta or leader is updated, or contains any down/pending peer.
Expand Down Expand Up @@ -678,10 +683,6 @@ func (c *RaftCluster) processRegionHeartbeat(region *core.RegionInfo) error {
c.prepareChecker.collect(region)
}

if c.regionStats != nil {
c.regionStats.Observe(region, c.takeRegionStoresLocked(region))
}

for _, writeItem := range writeItems {
c.hotStat.Update(writeItem)
}
Expand Down

0 comments on commit 56ad752

Please sign in to comment.