Skip to content

Commit

Permalink
infosync: correct the PD API call of GetLabelRules (#55189) (#55197)
Browse files Browse the repository at this point in the history
close #55188
  • Loading branch information
ti-chi-bot authored Aug 5, 2024
1 parent 787fe24 commit 891151b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6820,13 +6820,13 @@ def go_deps():
name = "com_github_tikv_pd_client",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/pd/client",
sha256 = "e2fe0801c24673fb037acb4b8aaef75ccc6988328d8ad5aa24f1b5c5a0bfca77",
strip_prefix = "github.com/tikv/pd/client@v0.0.0-20240725040006-f1a90966c375",
sha256 = "e79afe8219aba87a977d77608e36db7549d9e515c224d79c8c77c2090dddca2e",
strip_prefix = "github.com/tikv/pd/client@v0.0.0-20240805094238-3d11c4d12be1",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
"http://ats.apps.svc/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
"http://ats.apps.svc/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ require (
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tidwall/btree v1.7.0
github.com/tikv/client-go/v2 v2.0.8-0.20240801083730-f8e321f39dd5
github.com/tikv/pd/client v0.0.0-20240725040006-f1a90966c375
github.com/tikv/pd/client v0.0.0-20240805094238-3d11c4d12be1
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
github.com/twmb/murmur3 v1.1.6
github.com/uber/jaeger-client-go v2.22.1+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,8 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tikv/client-go/v2 v2.0.8-0.20240801083730-f8e321f39dd5 h1:cXfHJBQg/sJSXJd9nNReDQGtR2Qou85JrxBQea3IhIk=
github.com/tikv/client-go/v2 v2.0.8-0.20240801083730-f8e321f39dd5/go.mod h1:+vXk4Aex17GnI8gfSMPxrL0SQLbBYgP3Db4FvHiImwM=
github.com/tikv/pd/client v0.0.0-20240725040006-f1a90966c375 h1:I5UeNdxggvuyLT8xuzZiODvuw4uFDdi/R280DprOzLs=
github.com/tikv/pd/client v0.0.0-20240725040006-f1a90966c375/go.mod h1:4HXfGoT4O+lOWfOqxOvsIca9v+sYRL/W35duf+rgRsY=
github.com/tikv/pd/client v0.0.0-20240805094238-3d11c4d12be1 h1:fDaB+Nzx77qNWbdI9CaRHEdrFWwpdmH75jDzEgCupf4=
github.com/tikv/pd/client v0.0.0-20240805094238-3d11c4d12be1/go.mod h1:4HXfGoT4O+lOWfOqxOvsIca9v+sYRL/W35duf+rgRsY=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
Expand Down
4 changes: 2 additions & 2 deletions pkg/domain/infosync/label_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (lm *PDLabelManager) GetAllLabelRules(ctx context.Context) ([]*label.Rule,
}

// GetLabelRules implements GetLabelRules
func (lm *PDLabelManager) GetLabelRules(ctx context.Context, _ []string) (map[string]*label.Rule, error) {
labelRules, err := lm.pdHTTPCli.GetAllRegionLabelRules(ctx)
func (lm *PDLabelManager) GetLabelRules(ctx context.Context, ruleIDs []string) (map[string]*label.Rule, error) {
labelRules, err := lm.pdHTTPCli.GetRegionLabelRulesByIDs(ctx, ruleIDs)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/lightning/backend/local/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ go_library(
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//util",
"@com_github_tikv_pd_client//:client",
"@com_github_tikv_pd_client//errs",
"@com_github_tikv_pd_client//http",
"@com_github_tikv_pd_client//retry",
"@org_golang_google_grpc//:grpc",
Expand Down
3 changes: 2 additions & 1 deletion pkg/lightning/backend/local/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
tikvstore "github.com/tikv/client-go/v2/kv"
"github.com/tikv/client-go/v2/oracle"
pd "github.com/tikv/pd/client"
pderrs "github.com/tikv/pd/client/errs"
"go.uber.org/atomic"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -350,7 +351,7 @@ func (e *TiKVChecksumManager) Checksum(ctx context.Context, tableInfo *checkpoin
)
physicalTS, logicalTS, err = e.manager.pdClient.GetTS(ctx)
for err != nil {
if !pd.IsLeaderChange(errors.Cause(err)) {
if !pderrs.IsLeaderChange(errors.Cause(err)) {
return nil, errors.Annotate(err, "fetch tso from pd failed")
}
retryTime++
Expand Down

0 comments on commit 891151b

Please sign in to comment.