client: update pd/client to repair kvproto compatibility (#667)

Signed-off-by: HuSharp <jinhao.hu@pingcap.com>
This commit is contained in:
Hu# 2023-01-18 19:18:40 +08:00 committed by GitHub
parent fe5b35c5f5
commit 2a02753d9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1863 additions and 86 deletions

26
go.mod
View File

@ -8,29 +8,29 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.2
github.com/google/btree v1.1.2
github.com/google/uuid v1.1.2
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0
github.com/opentracing/opentracing-go v1.2.0
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989
github.com/pingcap/kvproto v0.0.0-20230104090009-7c5d757b6e12
github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81
github.com/pingcap/kvproto v0.0.0-20230118055818-adcf4c414bfd
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/stathat/consistent v1.0.0
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.1
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a
github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07
github.com/tikv/pd/client v0.0.0-20230118040950-082fc6a9bc2e
github.com/twmb/murmur3 v1.1.3
go.etcd.io/etcd/api/v3 v3.5.2
go.etcd.io/etcd/client/v3 v3.5.2
go.uber.org/atomic v1.10.0
go.uber.org/goleak v1.1.12
go.uber.org/zap v1.20.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
google.golang.org/grpc v1.43.0
golang.org/x/sync v0.1.0
google.golang.org/grpc v1.51.0
)
require (
@ -40,7 +40,7 @@ require (
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.18.1 // indirect
@ -50,11 +50,11 @@ require (
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/protobuf v1.26.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
stathat.com/c/consistent v1.0.0 // indirect

920
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,13 @@ require (
github.com/ninedraft/israce v0.0.3
github.com/pingcap/errors v0.11.5-0.20221009092201-b66cddb77c32
github.com/pingcap/failpoint v0.0.0-20220423142525-ae43b7f4e5c3
github.com/pingcap/kvproto v0.0.0-20230105060948-64890fa4f6c1
github.com/pingcap/kvproto v0.0.0-20230118055818-adcf4c414bfd
github.com/pingcap/tidb v1.1.0-beta.0.20230109054422-b477b1c94620
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.1
github.com/tidwall/gjson v1.14.1
github.com/tikv/client-go/v2 v2.0.4
github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07
github.com/tikv/client-go/v2 v2.0.5-0.20230112062023-fe5b35c5f5dc
github.com/tikv/pd/client v0.0.0-20230118040950-082fc6a9bc2e
go.uber.org/goleak v1.2.0
)
@ -89,11 +89,13 @@ require (
golang.org/x/text v0.6.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.2.0 // indirect
google.golang.org/genproto v0.0.0-20220719170305-83ca9fad585f // indirect
google.golang.org/grpc v1.48.0 // indirect
google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace github.com/tikv/client-go/v2 => ../
replace github.com/pingcap/tidb => github.com/HuSharp/tidb v0.0.0-20230118064626-888c2ba2e80f

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,7 @@ package tikv_test
import (
"context"
rmpb "github.com/pingcap/kvproto/pkg/resource_manager"
"sync"
"testing"
@ -141,15 +142,15 @@ type mockPDClient struct {
stop bool
}
func (c *mockPDClient) LoadGlobalConfig(ctx context.Context, names []string) ([]pd.GlobalConfigItem, error) {
return nil, nil
func (c *mockPDClient) LoadGlobalConfig(ctx context.Context, configPath string) ([]pd.GlobalConfigItem, int64, error) {
return nil, 0, nil
}
func (c *mockPDClient) StoreGlobalConfig(ctx context.Context, items []pd.GlobalConfigItem) error {
func (c *mockPDClient) StoreGlobalConfig(ctx context.Context, configPath string, items []pd.GlobalConfigItem) error {
return nil
}
func (c *mockPDClient) WatchGlobalConfig(ctx context.Context) (chan []pd.GlobalConfigItem, error) {
func (c *mockPDClient) WatchGlobalConfig(ctx context.Context, configPath string, revision int64) (chan []pd.GlobalConfigItem, error) {
return nil, nil
}
@ -297,6 +298,34 @@ func (c *mockPDClient) WatchKeyspaces(ctx context.Context) (chan []*keyspacepb.K
return nil, nil
}
func (c *mockPDClient) UpdateKeyspaceState(ctx context.Context, id uint32, state keyspacepb.KeyspaceState) (*keyspacepb.KeyspaceMeta, error) {
return nil, nil
}
func (c *mockPDClient) ListResourceGroups(ctx context.Context) ([]*rmpb.ResourceGroup, error) {
return nil, nil
}
func (c *mockPDClient) GetResourceGroup(ctx context.Context, resourceGroupName string) (*rmpb.ResourceGroup, error) {
return nil, nil
}
func (c *mockPDClient) AddResourceGroup(ctx context.Context, metaGroup *rmpb.ResourceGroup) (string, error) {
return "", nil
}
func (c *mockPDClient) ModifyResourceGroup(ctx context.Context, metaGroup *rmpb.ResourceGroup) (string, error) {
return "", nil
}
func (c *mockPDClient) DeleteResourceGroup(ctx context.Context, resourceGroupName string) (string, error) {
return "", nil
}
func (c *mockPDClient) AcquireTokenBuckets(ctx context.Context, request *rmpb.TokenBucketsRequest) ([]*rmpb.TokenBucketResponse, error) {
return nil, nil
}
func (c *mockPDClient) GetExternalTimestamp(ctx context.Context) (uint64, error) {
panic("unimplemented")
}
@ -304,3 +333,4 @@ func (c *mockPDClient) GetExternalTimestamp(ctx context.Context) (uint64, error)
func (c *mockPDClient) SetExternalTimestamp(ctx context.Context, tso uint64) error {
panic("unimplemented")
}

View File

@ -44,6 +44,7 @@ import (
"github.com/pingcap/kvproto/pkg/keyspacepb"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/kvproto/pkg/pdpb"
rmpb "github.com/pingcap/kvproto/pkg/resource_manager"
"github.com/pkg/errors"
"github.com/tikv/client-go/v2/oracle"
pd "github.com/tikv/pd/client"
@ -78,15 +79,15 @@ func NewPDClient(cluster *Cluster) pd.Client {
}
}
func (c *pdClient) LoadGlobalConfig(ctx context.Context, names []string) ([]pd.GlobalConfigItem, error) {
return nil, nil
func (c *pdClient) LoadGlobalConfig(ctx context.Context, configPath string) ([]pd.GlobalConfigItem, int64, error) {
return nil, 0, nil
}
func (c *pdClient) StoreGlobalConfig(ctx context.Context, items []pd.GlobalConfigItem) error {
func (c *pdClient) StoreGlobalConfig(ctx context.Context, configPath string, items []pd.GlobalConfigItem) error {
return nil
}
func (c *pdClient) WatchGlobalConfig(ctx context.Context) (chan []pd.GlobalConfigItem, error) {
func (c *pdClient) WatchGlobalConfig(ctx context.Context, configPath string, revision int64) (chan []pd.GlobalConfigItem, error) {
return nil, nil
}
@ -292,3 +293,31 @@ func (c *pdClient) LoadKeyspace(ctx context.Context, name string) (*keyspacepb.K
func (c *pdClient) WatchKeyspaces(ctx context.Context) (chan []*keyspacepb.KeyspaceMeta, error) {
return nil, nil
}
func (c *pdClient) UpdateKeyspaceState(ctx context.Context, id uint32, state keyspacepb.KeyspaceState) (*keyspacepb.KeyspaceMeta, error) {
return nil, nil
}
func (c *pdClient) ListResourceGroups(ctx context.Context) ([]*rmpb.ResourceGroup, error) {
return nil, nil
}
func (c *pdClient) GetResourceGroup(ctx context.Context, resourceGroupName string) (*rmpb.ResourceGroup, error) {
return nil, nil
}
func (c *pdClient) AddResourceGroup(ctx context.Context, metaGroup *rmpb.ResourceGroup) (string, error) {
return "", nil
}
func (c *pdClient) ModifyResourceGroup(ctx context.Context, metaGroup *rmpb.ResourceGroup) (string, error) {
return "", nil
}
func (c *pdClient) DeleteResourceGroup(ctx context.Context, resourceGroupName string) (string, error) {
return "", nil
}
func (c *pdClient) AcquireTokenBuckets(ctx context.Context, request *rmpb.TokenBucketsRequest) ([]*rmpb.TokenBucketResponse, error) {
return nil, nil
}