Skip to content

Commit

Permalink
partition: remove duplicate GetRegionByID (pingcap#58603)
Browse files Browse the repository at this point in the history
  • Loading branch information
okJiang authored Dec 30, 2024
1 parent 5934515 commit 70393b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ http_archive(
urls = [
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zip",
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zip",
"https://cache.hawkingrei.com/bazelbuild/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zipp",
"https://cache.hawkingrei.com/bazelbuild/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zip",
],
)
Expand Down
6 changes: 1 addition & 5 deletions pkg/ddl/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,7 @@ func checkPartitionReplica(replicaCount uint64, addingDefinitions []model.Partit
// For every region in the partition, if it has some corresponding peers and
// no pending peers, that means the replication has completed.
for _, region := range regions {
regionState, err := pdCli.GetRegionByID(ctx, region.Meta.Id)
if err != nil {
return needWait, errors.Trace(err)
}
tiflashPeerAtLeastOne := checkTiFlashPeerStoreAtLeastOne(stores, regionState.Meta.Peers)
tiflashPeerAtLeastOne := checkTiFlashPeerStoreAtLeastOne(stores, region.Meta.Peers)
failpoint.Inject("ForceTiflashNotAvailable", func(v failpoint.Value) {
tiflashPeerAtLeastOne = v.(bool)
})
Expand Down

0 comments on commit 70393b5

Please sign in to comment.