Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <jinhao.hu@pingcap.com>
  • Loading branch information
HuSharp committed Sep 6, 2023
1 parent 46406e7 commit d161acb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type RegionInfo struct {
flowRoundDivisor uint64
// buckets is not thread unsafe, it should be accessed by the request `report buckets` with greater version.
buckets unsafe.Pointer
// source is used to indicate region's source, such as FromHeartbeat/FromSync/InDisk.
// source is used to indicate region's source, such as FromHeartbeat/FromSync/FromStorage.
source RegionSource
}

Expand Down Expand Up @@ -685,7 +685,7 @@ func GenerateRegionGuideFunc(enableLog bool) RegionGuideFunc {
}
saveKV, saveCache, isNew = true, true, true
} else {
if origin.source == FromSync || origin.source == InDisk {
if origin.source == FromSync || origin.source == FromStorage {
isNew = true
}
r := region.GetRegionEpoch()
Expand Down Expand Up @@ -799,8 +799,8 @@ type RegionsInfo struct {
type RegionSource uint32

const (
// InDisk means region is stale.
InDisk RegionSource = iota
// FromStorage means region is stale.
FromStorage RegionSource = iota
// FromSync means region is stale.
FromSync
// FromHeartbeat means region is fresh.
Expand Down Expand Up @@ -854,7 +854,7 @@ func (r *RegionsInfo) CheckAndPutRegion(region *RegionInfo) []*RegionInfo {
origin, overlaps, rangeChanged := r.setRegionLocked(region, true, ols...)
r.t.Unlock()
r.UpdateSubTree(region, origin, overlaps, rangeChanged)
// InDisk means region is stale.
// FromStorage means region is stale.
r.AtomicAddStaleRegionCnt()
return overlaps
}
Expand Down

0 comments on commit d161acb

Please sign in to comment.