Skip to content

Commit

Permalink
region: remove error return logic (#6982)
Browse files Browse the repository at this point in the history
ref #6920

Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp authored Aug 24, 2023
1 parent cd4eb78 commit 75bb796
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions server/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,14 +694,12 @@ func GenerateRegionGuideFunc(enableLog bool) RegionGuideFunc {
(region.GetReplicationStatus().GetState() != origin.GetReplicationStatus().GetState() ||
region.GetReplicationStatus().GetStateId() != origin.GetReplicationStatus().GetStateId()) {
saveCache = true
return
}
// Do not save to kv, because 1) flashback will be eventually set to
// false, 2) flashback changes almost all regions in a cluster.
// Saving kv may downgrade PD performance when there are many regions.
if region.IsFlashbackChanged(origin) {
saveCache = true
return
}
if !origin.IsFromHeartbeat() {
isNew = true
Expand Down
2 changes: 2 additions & 0 deletions tests/server/region_syncer/region_syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ func TestPrepareChecker(t *testing.T) {
leaderServer = cluster.GetServer(cluster.GetLeader())
rc = leaderServer.GetServer().GetRaftCluster()
for _, region := range regions {
// Need to check if the region was recognized `isNew`.
region = region.Clone(core.WithFlashback(true, 1))
err = rc.HandleRegionHeartbeat(region)
re.NoError(err)
}
Expand Down

0 comments on commit 75bb796

Please sign in to comment.