From baa3812002b7ce5d68d8e9515b5a28dfb1c41955 Mon Sep 17 00:00:00 2001 From: ystaticy Date: Mon, 8 May 2023 17:19:07 +0800 Subject: [PATCH 1/7] introduce keyspace safepoint interface Signed-off-by: ystaticy --- go.mod | 4 +++ go.sum | 8 +++--- internal/client/client_interceptor.go | 36 +++++++++++++-------------- internal/mockstore/mocktikv/pd.go | 15 +++++++++++ 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 5e72fbf4f..f0d79e0d4 100644 --- a/go.mod +++ b/go.mod @@ -73,3 +73,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +replace github.com/pingcap/kvproto => github.com/tidbcloud/kvproto v0.0.0-20230504070030-4ceaef675854 + +replace github.com/tikv/pd/client => github.com/tidbcloud/pd-cse/client v0.0.0-20230504090022-fea484d60563 diff --git a/go.sum b/go.sum index 52198f479..53b308c1e 100644 --- a/go.sum +++ b/go.sum @@ -172,8 +172,6 @@ github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c h1:CgbKAHto5CQgW github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c/go.mod h1:4qGtCB0QK0wBzKtFEGDhxXnSnbQApw1gc9siScUl8ew= 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-20230419072653-dc3cd8784a19 h1:aGROoQpU8Sx9MhCspeSrDXpNkW1pcG+EWdMYxg4d5uo= -github.com/pingcap/kvproto v0.0.0-20230419072653-dc3cd8784a19/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk= github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 h1:HR/ylkkLmGdSSDaD8IDP+SZrdhV1Kibl9KrHxJ9eciw= github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -235,10 +233,12 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= +github.com/tidbcloud/kvproto v0.0.0-20230504070030-4ceaef675854 h1:Z7ZglLlToHxzEDF2iVA2QzwXrhWD8/4+YpKVPDw5Tg0= +github.com/tidbcloud/kvproto v0.0.0-20230504070030-4ceaef675854/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk= +github.com/tidbcloud/pd-cse/client v0.0.0-20230504090022-fea484d60563 h1:RztPOJlWLKuW1Qo21Ie6BVgntxB0fCwjNUi2A5C4LJo= +github.com/tidbcloud/pd-cse/client v0.0.0-20230504090022-fea484d60563/go.mod h1:Q5N81PnM6OjzUK8WBedHR8FaGhsD0Cps/0T3n2c2CdA= github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f h1:1BBlbLSCua+oK3xngEjPO2dj1oLcItJxhCzqYG6XANA= github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f/go.mod h1:2hGdvUNGLaCKLbEXC8JMiQz2JsbxEDCKGDOBGJTt0NQ= -github.com/tikv/pd/client v0.0.0-20230420042919-0e0313adef1f h1:Qa11LxEMz3tPlkcEJCnkc+phV00AaqXNNpqybx+QX04= -github.com/tikv/pd/client v0.0.0-20230420042919-0e0313adef1f/go.mod h1:5vgcvO020ZCdMZkTrRdS/wFZQUab82BSfKE38T61ro0= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 h1:j6JEOq5QWFker+d7mFQYOhjTZonQ7YkLTHm56dbn+yM= github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA= github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= diff --git a/internal/client/client_interceptor.go b/internal/client/client_interceptor.go index 3f3f6b62b..c8360a679 100644 --- a/internal/client/client_interceptor.go +++ b/internal/client/client_interceptor.go @@ -20,7 +20,6 @@ import ( "sync/atomic" "time" - "github.com/tikv/client-go/v2/internal/resourcecontrol" "github.com/tikv/client-go/v2/tikvrpc" "github.com/tikv/client-go/v2/tikvrpc/interceptor" "github.com/tikv/client-go/v2/util" @@ -100,26 +99,27 @@ func buildResourceControlInterceptor( return nil } // Make the request info. - reqInfo := resourcecontrol.MakeRequestInfo(req) + // reqInfo := resourcecontrol.MakeRequestInfo(req) // Build the interceptor. return func(next interceptor.RPCInterceptorFunc) interceptor.RPCInterceptorFunc { return func(target string, req *tikvrpc.Request) (*tikvrpc.Response, error) { - consumption, penalty, err := ResourceControlInterceptor.OnRequestWait(ctx, resourceGroupName, reqInfo) - if err != nil { - return nil, err - } - req.GetResourceControlContext().Penalty = penalty - ruRuntimeStats.Update(consumption) - resp, err := next(target, req) - if resp != nil { - respInfo := resourcecontrol.MakeResponseInfo(resp) - consumption, err = ResourceControlInterceptor.OnResponse(resourceGroupName, reqInfo, respInfo) - if err != nil { - return nil, err - } - ruRuntimeStats.Update(consumption) - } - return resp, err + //consumption, penalty, err := ResourceControlInterceptor.OnRequestWait(ctx, resourceGroupName, reqInfo) + //if err != nil { + // return nil, err + //} + //req.GetResourceControlContext().Penalty = penalty + //ruRuntimeStats.Update(consumption) + //resp, err := next(target, req) + //if resp != nil { + // respInfo := resourcecontrol.MakeResponseInfo(resp) + // consumption, err = ResourceControlInterceptor.OnResponse(resourceGroupName, reqInfo, respInfo) + // if err != nil { + // return nil, err + // } + // ruRuntimeStats.Update(consumption) + //} + //return resp, err + return nil, nil } } } diff --git a/internal/mockstore/mocktikv/pd.go b/internal/mockstore/mocktikv/pd.go index d5ac75ad5..9e6c6cd0c 100644 --- a/internal/mockstore/mocktikv/pd.go +++ b/internal/mockstore/mocktikv/pd.go @@ -71,6 +71,21 @@ type pdClient struct { externalTimestamp atomic.Uint64 } +func (c *pdClient) UpdateGCSafePointV2(ctx context.Context, keyspaceID uint32, safePoint uint64) (uint64, error) { + //TODO implement me + panic("implement me") +} + +func (c *pdClient) UpdateServiceSafePointV2(ctx context.Context, keyspaceID uint32, serviceID string, ttl int64, safePoint uint64) (uint64, error) { + //TODO implement me + panic("implement me") +} + +func (c *pdClient) WatchGCSafePointV2(ctx context.Context) (chan []*pdpb.SafePointEvent, error) { + //TODO implement me + panic("implement me") +} + // NewPDClient creates a mock pd.Client that uses local timestamp and meta data // from a Cluster. func NewPDClient(cluster *Cluster) pd.Client { From e91a154c4236e62af2f77ad09a152e65aec8de47 Mon Sep 17 00:00:00 2001 From: ystaticy Date: Mon, 8 May 2023 19:42:54 +0800 Subject: [PATCH 2/7] update master pd client Signed-off-by: ystaticy --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index f0d79e0d4..da2a4d7fa 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 - github.com/pingcap/kvproto v0.0.0-20230419072653-dc3cd8784a19 + github.com/pingcap/kvproto v0.0.0-20230426023724-d90a321b46be github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 @@ -74,6 +74,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/pingcap/kvproto => github.com/tidbcloud/kvproto v0.0.0-20230504070030-4ceaef675854 +replace github.com/pingcap/kvproto => github.com/ystaticy/kvproto v0.0.0-20230508095741-b0746f7e0103 -replace github.com/tikv/pd/client => github.com/tidbcloud/pd-cse/client v0.0.0-20230504090022-fea484d60563 +replace github.com/tikv/pd/client => github.com/ystaticy/pd/client v0.0.0-20230508113559-f81e14d76916 diff --git a/go.sum b/go.sum index 53b308c1e..52d381b3b 100644 --- a/go.sum +++ b/go.sum @@ -233,16 +233,16 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= -github.com/tidbcloud/kvproto v0.0.0-20230504070030-4ceaef675854 h1:Z7ZglLlToHxzEDF2iVA2QzwXrhWD8/4+YpKVPDw5Tg0= -github.com/tidbcloud/kvproto v0.0.0-20230504070030-4ceaef675854/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk= -github.com/tidbcloud/pd-cse/client v0.0.0-20230504090022-fea484d60563 h1:RztPOJlWLKuW1Qo21Ie6BVgntxB0fCwjNUi2A5C4LJo= -github.com/tidbcloud/pd-cse/client v0.0.0-20230504090022-fea484d60563/go.mod h1:Q5N81PnM6OjzUK8WBedHR8FaGhsD0Cps/0T3n2c2CdA= github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f h1:1BBlbLSCua+oK3xngEjPO2dj1oLcItJxhCzqYG6XANA= github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f/go.mod h1:2hGdvUNGLaCKLbEXC8JMiQz2JsbxEDCKGDOBGJTt0NQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 h1:j6JEOq5QWFker+d7mFQYOhjTZonQ7YkLTHm56dbn+yM= github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA= github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= +github.com/ystaticy/kvproto v0.0.0-20230508095741-b0746f7e0103 h1:dNVGeKIP8lXkg5mn9DcZYu0cv1k5MoZjzKgP8yWrpis= +github.com/ystaticy/kvproto v0.0.0-20230508095741-b0746f7e0103/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk= +github.com/ystaticy/pd/client v0.0.0-20230508113559-f81e14d76916 h1:b0zFHAcXJ/UiPr1cnK6wqBuozDbqK7ZYb/zqPd6ikxc= +github.com/ystaticy/pd/client v0.0.0-20230508113559-f81e14d76916/go.mod h1:MdzacIG9l/qdsp+W/DT+9V25CIgUfuB0WGN1iy9eOKM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= From d0dd421bae760302eb4697195ebc3b7899511e36 Mon Sep 17 00:00:00 2001 From: ystaticy Date: Wed, 17 May 2023 16:51:11 +0800 Subject: [PATCH 3/7] change resp Signed-off-by: ystaticy --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index da2a4d7fa..db38dcf04 100644 --- a/go.mod +++ b/go.mod @@ -74,6 +74,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/pingcap/kvproto => github.com/ystaticy/kvproto v0.0.0-20230508095741-b0746f7e0103 +replace github.com/pingcap/kvproto => github.com/ystaticy/kvproto v0.0.0-20230517081408-0ac3ac00aaee -replace github.com/tikv/pd/client => github.com/ystaticy/pd/client v0.0.0-20230508113559-f81e14d76916 +replace github.com/tikv/pd/client => github.com/ystaticy/pd/client v0.0.0-20230517082919-05a5d724dd02 diff --git a/go.sum b/go.sum index 52d381b3b..39817ca72 100644 --- a/go.sum +++ b/go.sum @@ -239,10 +239,10 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 h1:j6JEOq github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA= github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= -github.com/ystaticy/kvproto v0.0.0-20230508095741-b0746f7e0103 h1:dNVGeKIP8lXkg5mn9DcZYu0cv1k5MoZjzKgP8yWrpis= -github.com/ystaticy/kvproto v0.0.0-20230508095741-b0746f7e0103/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk= -github.com/ystaticy/pd/client v0.0.0-20230508113559-f81e14d76916 h1:b0zFHAcXJ/UiPr1cnK6wqBuozDbqK7ZYb/zqPd6ikxc= -github.com/ystaticy/pd/client v0.0.0-20230508113559-f81e14d76916/go.mod h1:MdzacIG9l/qdsp+W/DT+9V25CIgUfuB0WGN1iy9eOKM= +github.com/ystaticy/kvproto v0.0.0-20230517081408-0ac3ac00aaee h1:6mQ99GgqPVjiyFkcwDNqTLv7D1btQDA5Lfh58rKyuLw= +github.com/ystaticy/kvproto v0.0.0-20230517081408-0ac3ac00aaee/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk= +github.com/ystaticy/pd/client v0.0.0-20230517082919-05a5d724dd02 h1:dxSUoxsHO2IwfdF2N67l+h5gAvPUcAlN8ZqeomNuL/4= +github.com/ystaticy/pd/client v0.0.0-20230517082919-05a5d724dd02/go.mod h1:MdzacIG9l/qdsp+W/DT+9V25CIgUfuB0WGN1iy9eOKM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= From c498e1a17db3f644b7cabfdc31ef13bc94ef2f59 Mon Sep 17 00:00:00 2001 From: ystaticy Date: Wed, 24 May 2023 10:26:12 +0800 Subject: [PATCH 4/7] merge cse-region-client Signed-off-by: ystaticy --- internal/client/client_interceptor.go | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/internal/client/client_interceptor.go b/internal/client/client_interceptor.go index c8360a679..3f3f6b62b 100644 --- a/internal/client/client_interceptor.go +++ b/internal/client/client_interceptor.go @@ -20,6 +20,7 @@ import ( "sync/atomic" "time" + "github.com/tikv/client-go/v2/internal/resourcecontrol" "github.com/tikv/client-go/v2/tikvrpc" "github.com/tikv/client-go/v2/tikvrpc/interceptor" "github.com/tikv/client-go/v2/util" @@ -99,27 +100,26 @@ func buildResourceControlInterceptor( return nil } // Make the request info. - // reqInfo := resourcecontrol.MakeRequestInfo(req) + reqInfo := resourcecontrol.MakeRequestInfo(req) // Build the interceptor. return func(next interceptor.RPCInterceptorFunc) interceptor.RPCInterceptorFunc { return func(target string, req *tikvrpc.Request) (*tikvrpc.Response, error) { - //consumption, penalty, err := ResourceControlInterceptor.OnRequestWait(ctx, resourceGroupName, reqInfo) - //if err != nil { - // return nil, err - //} - //req.GetResourceControlContext().Penalty = penalty - //ruRuntimeStats.Update(consumption) - //resp, err := next(target, req) - //if resp != nil { - // respInfo := resourcecontrol.MakeResponseInfo(resp) - // consumption, err = ResourceControlInterceptor.OnResponse(resourceGroupName, reqInfo, respInfo) - // if err != nil { - // return nil, err - // } - // ruRuntimeStats.Update(consumption) - //} - //return resp, err - return nil, nil + consumption, penalty, err := ResourceControlInterceptor.OnRequestWait(ctx, resourceGroupName, reqInfo) + if err != nil { + return nil, err + } + req.GetResourceControlContext().Penalty = penalty + ruRuntimeStats.Update(consumption) + resp, err := next(target, req) + if resp != nil { + respInfo := resourcecontrol.MakeResponseInfo(resp) + consumption, err = ResourceControlInterceptor.OnResponse(resourceGroupName, reqInfo, respInfo) + if err != nil { + return nil, err + } + ruRuntimeStats.Update(consumption) + } + return resp, err } } } From 4af45ef769341331536562dbaf8c7383e20ccf5e Mon Sep 17 00:00:00 2001 From: ystaticy Date: Wed, 24 May 2023 11:25:59 +0800 Subject: [PATCH 5/7] merge cse-region-client Signed-off-by: ystaticy --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c9ebd49a0..a6421c6ff 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( go.uber.org/goleak v1.1.12 go.uber.org/zap v1.24.0 golang.org/x/sync v0.2.0 - google.golang.org/grpc v1.55.0 + google.golang.org/grpc v1.54.0 ) require ( diff --git a/go.sum b/go.sum index 6786db334..898b4fed6 100644 --- a/go.sum +++ b/go.sum @@ -392,8 +392,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 60e711bf88416adb558908c76c3eae5663100028 Mon Sep 17 00:00:00 2001 From: ystaticy Date: Thu, 25 May 2023 15:28:04 +0800 Subject: [PATCH 6/7] update pd client Signed-off-by: ystaticy --- go.mod | 4 +--- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a6421c6ff..85b7a10e9 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/stretchr/testify v1.8.2 github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f - github.com/tikv/pd/client v0.0.0-20230518085737-f4241b0c82b0 + github.com/tikv/pd/client v0.0.0-20230525062939-ccb0bba4e10b 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 @@ -72,5 +72,3 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) - -replace github.com/tikv/pd/client => github.com/ystaticy/pd/client v0.0.0-20230523125600-7bc803e2c7af diff --git a/go.sum b/go.sum index 898b4fed6..9f19df82b 100644 --- a/go.sum +++ b/go.sum @@ -236,12 +236,12 @@ github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f h1:1BBlbLSCua+oK3xngEjPO2dj1oLcItJxhCzqYG6XANA= github.com/tikv/pd v0.0.0-20230420042919-0e0313adef1f/go.mod h1:2hGdvUNGLaCKLbEXC8JMiQz2JsbxEDCKGDOBGJTt0NQ= +github.com/tikv/pd/client v0.0.0-20230525062939-ccb0bba4e10b h1:gYuqNy+s+G3x1NEOhJdgZGloTDwM+61/+HKcGTe2D0I= +github.com/tikv/pd/client v0.0.0-20230525062939-ccb0bba4e10b/go.mod h1:0XDYjg3SIU19VYiqWzHygabCpZP1RIqB2SlxNOLYhdw= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 h1:j6JEOq5QWFker+d7mFQYOhjTZonQ7YkLTHm56dbn+yM= github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA= github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= -github.com/ystaticy/pd/client v0.0.0-20230523125600-7bc803e2c7af h1:47TdVBQQmTi8YD6fFeOdnFo9YE28HYerFUeuIWKWg48= -github.com/ystaticy/pd/client v0.0.0-20230523125600-7bc803e2c7af/go.mod h1:0XDYjg3SIU19VYiqWzHygabCpZP1RIqB2SlxNOLYhdw= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= From b6831e1da6a6b5df020c71e201fa361812096fd8 Mon Sep 17 00:00:00 2001 From: ystaticy Date: Thu, 25 May 2023 15:51:33 +0800 Subject: [PATCH 7/7] update pd client Signed-off-by: ystaticy --- internal/mockstore/mocktikv/pd.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/mockstore/mocktikv/pd.go b/internal/mockstore/mocktikv/pd.go index c8c4a6fb0..458a12b4b 100644 --- a/internal/mockstore/mocktikv/pd.go +++ b/internal/mockstore/mocktikv/pd.go @@ -72,18 +72,15 @@ type pdClient struct { } func (c *pdClient) UpdateGCSafePointV2(ctx context.Context, keyspaceID uint32, safePoint uint64) (uint64, error) { - //TODO implement me - panic("implement me") + panic("unimplemented") } func (c *pdClient) UpdateServiceSafePointV2(ctx context.Context, keyspaceID uint32, serviceID string, ttl int64, safePoint uint64) (uint64, error) { - //TODO implement me - panic("implement me") + panic("unimplemented") } func (c *pdClient) WatchGCSafePointV2(ctx context.Context, revision int64) (chan []*pdpb.SafePointEvent, error) { - //TODO implement me - panic("implement me") + panic("unimplemented") } // NewPDClient creates a mock pd.Client that uses local timestamp and meta data