Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6036,13 +6036,13 @@ def go_deps():
name = "com_github_pingcap_kvproto",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/kvproto",
sha256 = "c3294731f77b5b1044bce65c10cfc3a26887735d5adafbc0f7d92d22b3771d8a",
strip_prefix = "github.com/pingcap/kvproto@v0.0.0-20250516034819-e2a9bdfc70eb",
sha256 = "3f29b95b673c1ae6f556a4fa1469cf97b58f5cdbf7ebd150f010006253fcd132",
strip_prefix = "github.com/pingcap/kvproto@v0.0.0-20250521074834-db74bf0e3ac1",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250516034819-e2a9bdfc70eb.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250516034819-e2a9bdfc70eb.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250516034819-e2a9bdfc70eb.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250516034819-e2a9bdfc70eb.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250521074834-db74bf0e3ac1.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250521074834-db74bf0e3ac1.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250521074834-db74bf0e3ac1.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250521074834-db74bf0e3ac1.zip",
],
)
go_repository(
Expand Down Expand Up @@ -7233,27 +7233,27 @@ def go_deps():
build_tags = ["nextgen"],
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sha256 = "43c737d1c2d84af0f0b6ac408e0ef563ec3cb58de8dc3e60af3eb830c0713d2e",
strip_prefix = "github.com/tikv/client-go/v2@v2.0.8-0.20250520113040-1880726302f6",
sha256 = "189e6066ddc10455b7d82a3afe30f2c5c2e018afd07a5a5091ec02257377fbc4",
strip_prefix = "github.com/tikv/client-go/v2@v2.0.8-0.20250528090949-e84f1a780fa6",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250520113040-1880726302f6.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250520113040-1880726302f6.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250520113040-1880726302f6.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250520113040-1880726302f6.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250528090949-e84f1a780fa6.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250528090949-e84f1a780fa6.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250528090949-e84f1a780fa6.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250528090949-e84f1a780fa6.zip",
],
)
go_repository(
name = "com_github_tikv_pd_client",
build_tags = ["nextgen"],
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/pd/client",
sha256 = "c4ce5fd01bf97d4cb432b344f208a4f0c6517c87a7b602c099333fc559678b82",
strip_prefix = "github.com/tikv/pd/client@v0.0.0-20250506023316-1798400856a0",
sha256 = "f492708b330ccba276edfcd954f5b925c14824d2bb68bb9dcf7ef30b39689546",
strip_prefix = "github.com/tikv/pd/client@v0.0.0-20250528071146-6cd8a77df2fa",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250506023316-1798400856a0.zip",
"http://ats.apps.svc/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250506023316-1798400856a0.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250506023316-1798400856a0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250506023316-1798400856a0.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250528071146-6cd8a77df2fa.zip",
"http://ats.apps.svc/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250528071146-6cd8a77df2fa.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250528071146-6cd8a77df2fa.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/pd/client/com_github_tikv_pd_client-v0.0.0-20250528071146-6cd8a77df2fa.zip",
],
)
go_repository(
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ require (
github.com/pingcap/errors v0.11.5-0.20250523034308-74f78ae071ee
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/fn v1.0.0
github.com/pingcap/kvproto v0.0.0-20250516034819-e2a9bdfc70eb
github.com/pingcap/kvproto v0.0.0-20250521074834-db74bf0e3ac1
github.com/pingcap/log v1.1.1-0.20250514022801-14f3b4ca066e
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
github.com/pingcap/tidb/pkg/parser v0.0.0-20211011031125-9b13dc409c5e
Expand All @@ -111,8 +111,8 @@ require (
github.com/stretchr/testify v1.10.0
github.com/tdakkota/asciicheck v0.4.1
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tikv/client-go/v2 v2.0.8-0.20250520113040-1880726302f6
github.com/tikv/pd/client v0.0.0-20250506023316-1798400856a0
github.com/tikv/client-go/v2 v2.0.8-0.20250528090949-e84f1a780fa6
github.com/tikv/pd/client v0.0.0-20250528071146-6cd8a77df2fa
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67
github.com/twmb/murmur3 v1.1.6
github.com/uber/jaeger-client-go v2.22.1+incompatible
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,8 @@ github.com/pingcap/fn v1.0.0/go.mod h1:u9WZ1ZiOD1RpNhcI42RucFh/lBuzTu6rw88a+oF2Z
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
github.com/pingcap/kvproto v0.0.0-20250516034819-e2a9bdfc70eb h1:cTPTugbdIV2yklyOM95nqhMn7S5PvGgzKykOo/f8VtE=
github.com/pingcap/kvproto v0.0.0-20250516034819-e2a9bdfc70eb/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
github.com/pingcap/kvproto v0.0.0-20250521074834-db74bf0e3ac1 h1:peVY7sHw2RCDH8lEHEVMYe4M7GXyeXRKR8QDc5f5dM4=
github.com/pingcap/kvproto v0.0.0-20250521074834-db74bf0e3ac1/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM=
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
github.com/pingcap/log v1.1.1-0.20250514022801-14f3b4ca066e h1:8AZZRv1Ox9FVGATVZBBgr6y1MrNBQFABEdovNJt1QIc=
Expand Down Expand Up @@ -847,10 +847,10 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/tikv/client-go/v2 v2.0.8-0.20250520113040-1880726302f6 h1:W1w3IoTa19QWa+9Sp5Mosb5zJK4wIe8J8Xl7czd+X84=
github.com/tikv/client-go/v2 v2.0.8-0.20250520113040-1880726302f6/go.mod h1:zpQA8FqzIvlL+l4edCFlyKMd8geAZrKQZbKMLLRc+/g=
github.com/tikv/pd/client v0.0.0-20250506023316-1798400856a0 h1:WSze0cvshy8661tiEbY7NJiC2yvP7Iwg5RWpSwfgY9k=
github.com/tikv/pd/client v0.0.0-20250506023316-1798400856a0/go.mod h1:W9PluuNqolVcRUsw3bnfFRUMPXWkobJkGSpaGYgQk0Y=
github.com/tikv/client-go/v2 v2.0.8-0.20250528090949-e84f1a780fa6 h1:2zlzX0UDbNbqjxjs0/qnVRTuuF8t4PJpL1e6uDKYeLQ=
github.com/tikv/client-go/v2 v2.0.8-0.20250528090949-e84f1a780fa6/go.mod h1:SWsAhPA9u76Zu5/jzzn+ad5Aj8PnCm2JM50KYCbLLTQ=
github.com/tikv/pd/client v0.0.0-20250528071146-6cd8a77df2fa h1:mZZW8kDe3mspK5nM6meDjEhtnSVA4JIt4gm7FCC1yYA=
github.com/tikv/pd/client v0.0.0-20250528071146-6cd8a77df2fa/go.mod h1:yc63HG/FHgJNvfDPqMOciMtOju1QDYaxajqyN6rnFX0=
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk=
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ go_library(
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//txnkv/transaction",
"@com_github_tikv_pd_client//:client",
"@com_github_tikv_pd_client//constants",
"@com_github_tikv_pd_client//http",
"@com_github_tikv_pd_client//opt",
"@com_github_tikv_pd_client//pkg/circuitbreaker",
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/infosync/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ go_library(
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_pd_client//:client",
"@com_github_tikv_pd_client//clients/router",
"@com_github_tikv_pd_client//constants",
"@com_github_tikv_pd_client//errs",
"@com_github_tikv_pd_client//http",
"@com_github_tikv_pd_client//opt",
Expand Down
3 changes: 2 additions & 1 deletion pkg/domain/infosync/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
"github.com/tikv/client-go/v2/oracle"
"github.com/tikv/client-go/v2/tikv"
pd "github.com/tikv/pd/client"
"github.com/tikv/pd/client/constants"
pdhttp "github.com/tikv/pd/client/http"
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/client/v3/concurrency"
Expand Down Expand Up @@ -324,7 +325,7 @@ func (is *InfoSyncer) initPlacementManager() {
func (is *InfoSyncer) initResourceManagerClient(pdCli pd.Client) {
var cli pd.ResourceManagerClient = pdCli
if pdCli == nil {
cli = NewMockResourceManagerClient()
cli = NewMockResourceManagerClient(constants.NullKeyspaceID)
}
failpoint.Inject("managerAlreadyCreateSomeGroups", func(val failpoint.Value) {
if val.(bool) {
Expand Down
14 changes: 8 additions & 6 deletions pkg/domain/infosync/resource_manager_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ import (

type mockResourceManagerClient struct {
sync.RWMutex
groups map[string]*rmpb.ResourceGroup
eventCh chan []*meta_storagepb.Event
keyspaceID uint32
groups map[string]*rmpb.ResourceGroup
eventCh chan []*meta_storagepb.Event
}

// NewMockResourceManagerClient return a mock ResourceManagerClient for test usage.
func NewMockResourceManagerClient() pd.ResourceManagerClient {
func NewMockResourceManagerClient(keyspaceID uint32) pd.ResourceManagerClient {
mockMgr := &mockResourceManagerClient{
groups: make(map[string]*rmpb.ResourceGroup),
eventCh: make(chan []*meta_storagepb.Event, 100),
keyspaceID: keyspaceID,
groups: make(map[string]*rmpb.ResourceGroup),
eventCh: make(chan []*meta_storagepb.Event, 100),
}
mockMgr.groups[resourcegroup.DefaultResourceGroupName] = &rmpb.ResourceGroup{
Name: resourcegroup.DefaultResourceGroupName,
Expand Down Expand Up @@ -146,7 +148,7 @@ func (*mockResourceManagerClient) LoadResourceGroups(context.Context) ([]*rmpb.R
}

func (m *mockResourceManagerClient) Watch(_ context.Context, key []byte, _ ...opt.MetaStorageOption) (chan []*meta_storagepb.Event, error) {
if bytes.Equal(pd.GroupSettingsPathPrefixBytes, key) {
if bytes.Equal(pd.GroupSettingsPathPrefixBytes(m.keyspaceID), key) {
return m.eventCh, nil
}
return nil, nil
Expand Down
7 changes: 6 additions & 1 deletion pkg/domain/runaway.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/tikv/client-go/v2/tikv"
pd "github.com/tikv/pd/client"
"github.com/tikv/pd/client/constants"
rmclient "github.com/tikv/pd/client/resource_group/controller"
"go.uber.org/zap"
)
Expand All @@ -43,7 +44,11 @@ func (do *Domain) initResourceGroupsController(ctx context.Context, pdClient pd.
return nil
}

control, err := rmclient.NewResourceGroupController(ctx, uniqueID, pdClient, nil, rmclient.WithMaxWaitDuration(runaway.MaxWaitDuration))
keyspaceID := constants.NullKeyspaceID
if codec := do.Store().GetCodec(); codec != nil {
keyspaceID = uint32(codec.GetKeyspaceID())
}
control, err := rmclient.NewResourceGroupController(ctx, uniqueID, pdClient, nil, keyspaceID, rmclient.WithMaxWaitDuration(runaway.MaxWaitDuration))
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/executor/internal/calibrateresource/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ go_test(
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_pd_client//:client",
"@com_github_tikv_pd_client//constants",
"@com_github_tikv_pd_client//opt",
"@com_github_tikv_pd_client//resource_group/controller",
"@org_uber_go_goleak//:goleak",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/pingcap/tidb/pkg/types"
"github.com/stretchr/testify/require"
pd "github.com/tikv/pd/client"
"github.com/tikv/pd/client/constants"
"github.com/tikv/pd/client/opt"
rmclient "github.com/tikv/pd/client/resource_group/controller"
)
Expand Down Expand Up @@ -65,7 +66,7 @@ func TestCalibrateResource(t *testing.T) {
mockPrivider := &mockResourceGroupProvider{
cfg: *oldCfg,
}
resourceCtl, err := rmclient.NewResourceGroupController(context.Background(), 1, mockPrivider, nil)
resourceCtl, err := rmclient.NewResourceGroupController(context.Background(), 1, mockPrivider, nil, constants.NullKeyspaceID)
require.NoError(t, err)
do.SetResourceGroupsController(resourceCtl)

Expand Down
1 change: 1 addition & 0 deletions pkg/store/copr/copr_test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ go_test(
"@com_github_tikv_client_go_v2//testutils",
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_pd_client//:client",
"@com_github_tikv_pd_client//constants",
"@com_github_tikv_pd_client//opt",
"@com_github_tikv_pd_client//resource_group/controller",
"@org_uber_go_goleak//:goleak",
Expand Down
3 changes: 2 additions & 1 deletion pkg/store/copr/copr_test/coprocessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/tikv/client-go/v2/testutils"
pd "github.com/tikv/pd/client"
"github.com/tikv/pd/client/constants"
"github.com/tikv/pd/client/opt"
rmclient "github.com/tikv/pd/client/resource_group/controller"
)
Expand Down Expand Up @@ -262,7 +263,7 @@ func TestBuildCopIteratorWithRunawayChecker(t *testing.T) {
}

ranges := copr.BuildKeyRanges("a", "c", "d", "e", "h", "x", "y", "z")
resourceCtl, err := rmclient.NewResourceGroupController(context.Background(), 1, mockPrivider, nil)
resourceCtl, err := rmclient.NewResourceGroupController(context.Background(), 1, mockPrivider, nil, constants.NullKeyspaceID)
require.NoError(t, err)
manager := runaway.NewRunawayManager(resourceCtl, "mock://test", nil, nil, nil, nil)
defer manager.Stop()
Expand Down
2 changes: 2 additions & 0 deletions pkg/store/mockstore/unistore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ go_library(
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//tikvrpc",
"@com_github_tikv_pd_client//:client",
"@com_github_tikv_pd_client//clients/gc",
"@com_github_tikv_pd_client//clients/router",
"@com_github_tikv_pd_client//clients/tso",
"@com_github_tikv_pd_client//constants",
"@com_github_tikv_pd_client//opt",
"@com_github_tikv_pd_client//pkg/caller",
"@com_github_tikv_pd_client//servicediscovery",
Expand Down
16 changes: 15 additions & 1 deletion pkg/store/mockstore/unistore/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ import (
us "github.com/pingcap/tidb/pkg/store/mockstore/unistore/tikv"
"github.com/tikv/client-go/v2/oracle"
pd "github.com/tikv/pd/client"
"github.com/tikv/pd/client/clients/gc"
"github.com/tikv/pd/client/clients/router"
"github.com/tikv/pd/client/clients/tso"
"github.com/tikv/pd/client/constants"
"github.com/tikv/pd/client/opt"
"github.com/tikv/pd/client/pkg/caller"
sd "github.com/tikv/pd/client/servicediscovery"
Expand All @@ -59,9 +61,13 @@ type pdClient struct {
}

func newPDClient(pd *us.MockPD, addrs []string, keyspaceMeta *keyspacepb.KeyspaceMeta) *pdClient {
keyspaceID := constants.NullKeyspaceID
if keyspaceMeta != nil {
keyspaceID = keyspaceMeta.GetId()
}
return &pdClient{
MockPD: pd,
ResourceManagerClient: infosync.NewMockResourceManagerClient(),
ResourceManagerClient: infosync.NewMockResourceManagerClient(keyspaceID),
serviceSafePoints: make(map[string]uint64),
globalConfig: make(map[string]string),
addrs: addrs,
Expand Down Expand Up @@ -425,3 +431,11 @@ func (c *pdClient) WatchGCSafePointV2(ctx context.Context, revision int64) (chan
func (c *pdClient) WithCallerComponent(component caller.Component) pd.Client {
return c
}

func (c *pdClient) GetGCInternalController(keyspaceID uint32) gc.InternalController {
return nil
}

func (c *pdClient) GetGCStatesClient(keyspaceID uint32) gc.GCStatesClient {
return nil
}