Skip to content

Commit 891151b

Browse files
authored
infosync: correct the PD API call of GetLabelRules (#55189) (#55197)
close #55188
1 parent 787fe24 commit 891151b

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

DEPS.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6820,13 +6820,13 @@ def go_deps():
68206820
name = "com_github_tikv_pd_client",
68216821
build_file_proto_mode = "disable_global",
68226822
importpath = "github.com/tikv/pd/client",
6823-
sha256 = "e2fe0801c24673fb037acb4b8aaef75ccc6988328d8ad5aa24f1b5c5a0bfca77",
6824-
strip_prefix = "github.com/tikv/pd/[email protected]20240725040006-f1a90966c375",
6823+
sha256 = "e79afe8219aba87a977d77608e36db7549d9e515c224d79c8c77c2090dddca2e",
6824+
strip_prefix = "github.com/tikv/pd/[email protected]20240805094238-3d11c4d12be1",
68256825
urls = [
6826-
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
6827-
"http://ats.apps.svc/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
6828-
"https://cache.hawkingrei.com/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
6829-
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240725040006-f1a90966c375.zip",
6826+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
6827+
"http://ats.apps.svc/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
6828+
"https://cache.hawkingrei.com/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
6829+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20240805094238-3d11c4d12be1.zip",
68306830
],
68316831
)
68326832
go_repository(

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ require (
107107
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
108108
github.com/tidwall/btree v1.7.0
109109
github.com/tikv/client-go/v2 v2.0.8-0.20240801083730-f8e321f39dd5
110-
github.com/tikv/pd/client v0.0.0-20240725040006-f1a90966c375
110+
github.com/tikv/pd/client v0.0.0-20240805094238-3d11c4d12be1
111111
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
112112
github.com/twmb/murmur3 v1.1.6
113113
github.com/uber/jaeger-client-go v2.22.1+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,8 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
786786
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
787787
github.com/tikv/client-go/v2 v2.0.8-0.20240801083730-f8e321f39dd5 h1:cXfHJBQg/sJSXJd9nNReDQGtR2Qou85JrxBQea3IhIk=
788788
github.com/tikv/client-go/v2 v2.0.8-0.20240801083730-f8e321f39dd5/go.mod h1:+vXk4Aex17GnI8gfSMPxrL0SQLbBYgP3Db4FvHiImwM=
789-
github.com/tikv/pd/client v0.0.0-20240725040006-f1a90966c375 h1:I5UeNdxggvuyLT8xuzZiODvuw4uFDdi/R280DprOzLs=
790-
github.com/tikv/pd/client v0.0.0-20240725040006-f1a90966c375/go.mod h1:4HXfGoT4O+lOWfOqxOvsIca9v+sYRL/W35duf+rgRsY=
789+
github.com/tikv/pd/client v0.0.0-20240805094238-3d11c4d12be1 h1:fDaB+Nzx77qNWbdI9CaRHEdrFWwpdmH75jDzEgCupf4=
790+
github.com/tikv/pd/client v0.0.0-20240805094238-3d11c4d12be1/go.mod h1:4HXfGoT4O+lOWfOqxOvsIca9v+sYRL/W35duf+rgRsY=
791791
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
792792
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
793793
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=

pkg/domain/infosync/label_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func (lm *PDLabelManager) GetAllLabelRules(ctx context.Context) ([]*label.Rule,
6060
}
6161

6262
// GetLabelRules implements GetLabelRules
63-
func (lm *PDLabelManager) GetLabelRules(ctx context.Context, _ []string) (map[string]*label.Rule, error) {
64-
labelRules, err := lm.pdHTTPCli.GetAllRegionLabelRules(ctx)
63+
func (lm *PDLabelManager) GetLabelRules(ctx context.Context, ruleIDs []string) (map[string]*label.Rule, error) {
64+
labelRules, err := lm.pdHTTPCli.GetRegionLabelRulesByIDs(ctx, ruleIDs)
6565
if err != nil {
6666
return nil, err
6767
}

pkg/lightning/backend/local/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ go_library(
8484
"@com_github_tikv_client_go_v2//tikv",
8585
"@com_github_tikv_client_go_v2//util",
8686
"@com_github_tikv_pd_client//:client",
87+
"@com_github_tikv_pd_client//errs",
8788
"@com_github_tikv_pd_client//http",
8889
"@com_github_tikv_pd_client//retry",
8990
"@org_golang_google_grpc//:grpc",

pkg/lightning/backend/local/checksum.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
tikvstore "github.com/tikv/client-go/v2/kv"
3838
"github.com/tikv/client-go/v2/oracle"
3939
pd "github.com/tikv/pd/client"
40+
pderrs "github.com/tikv/pd/client/errs"
4041
"go.uber.org/atomic"
4142
"go.uber.org/zap"
4243
)
@@ -350,7 +351,7 @@ func (e *TiKVChecksumManager) Checksum(ctx context.Context, tableInfo *checkpoin
350351
)
351352
physicalTS, logicalTS, err = e.manager.pdClient.GetTS(ctx)
352353
for err != nil {
353-
if !pd.IsLeaderChange(errors.Cause(err)) {
354+
if !pderrs.IsLeaderChange(errors.Cause(err)) {
354355
return nil, errors.Annotate(err, "fetch tso from pd failed")
355356
}
356357
retryTime++

0 commit comments

Comments
 (0)