Skip to content

Commit

Permalink
Update the kvproto
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Jan 17, 2025
1 parent 665cbfa commit 54b9646
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 5,134 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23
// When you modify PD cooperatively with kvproto, this will be useful to submit the PR to PD and the PR to
// kvproto at the same time. You can run `go mod tidy` to make it replaced with go-mod style specification.
// After the PR to kvproto is merged, remember to comment this out and run `go mod tidy`.
replace github.com/pingcap/kvproto => github.com/JmPotato/kvproto v0.0.0-20250117041351-579bbd411428
// replace github.com/pingcap/kvproto => github.com/$YourPrivateRepo $YourPrivateBranch

require (
github.com/AlekSi/gocov-xml v1.0.0
Expand Down Expand Up @@ -34,7 +34,7 @@ require (
github.com/pingcap/errcode v0.3.0
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/kvproto v0.0.0-20250117013947-1fdf41372412
github.com/pingcap/kvproto v0.0.0-20250117122752-2b87602a94a1
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3
github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21
github.com/pingcap/tidb-dashboard v0.0.0-20241104061623-bce95733dad7
Expand Down
1,716 changes: 9 additions & 1,707 deletions go.sum

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1554,10 +1554,20 @@ func (s *GrpcServer) QueryRegion(stream pdpb.PD_QueryRegionServer) error {
if clusterID := keypath.ClusterID(); request.GetHeader().GetClusterId() != clusterID {
return errs.ErrMismatchClusterID(clusterID, request.GetHeader().GetClusterId())
}
needBuckets := s.GetRaftCluster().GetStoreConfig().IsEnableRegionBucket() && request.GetNeedBuckets()
rc := s.GetRaftCluster()
if rc == nil {
resp := &pdpb.QueryRegionResponse{
Header: notBootstrappedHeader(),
}
if err = stream.Send(resp); err != nil {
return errors.WithStack(err)
}
continue

Check warning on line 1565 in server/grpc_service.go

View check run for this annotation

Codecov / codecov/patch

server/grpc_service.go#L1554-L1565

Added lines #L1554 - L1565 were not covered by tests
}
needBuckets := rc.GetStoreConfig().IsEnableRegionBucket() && request.GetNeedBuckets()

start := time.Now()
keyIDMap, prevKeyIDMap, regionsByID := s.GetRaftCluster().QueryRegions(
keyIDMap, prevKeyIDMap, regionsByID := rc.QueryRegions(
request.GetKeys(),
request.GetPrevKeys(),
request.GetIds(),
Expand Down
3 changes: 1 addition & 2 deletions tests/integrations/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/tikv/pd/tests/integrations
go 1.23

replace (
github.com/pingcap/kvproto => github.com/JmPotato/kvproto v0.0.0-20250117041351-579bbd411428
github.com/tikv/pd => ../../
github.com/tikv/pd/client => ../../client
github.com/tikv/pd/tests/integrations/mcs => ./mcs
Expand All @@ -15,7 +14,7 @@ require (
github.com/go-sql-driver/mysql v1.7.0
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/kvproto v0.0.0-20250117013947-1fdf41372412
github.com/pingcap/kvproto v0.0.0-20250117122752-2b87602a94a1
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/client_model v0.6.1
Expand Down
1,719 changes: 9 additions & 1,710 deletions tests/integrations/go.sum

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/tikv/pd/tools
go 1.23

replace (
github.com/pingcap/kvproto => github.com/JmPotato/kvproto v0.0.0-20250117041351-579bbd411428
github.com/tikv/pd => ../
github.com/tikv/pd/client => ../client
)
Expand All @@ -23,7 +22,7 @@ require (
github.com/mattn/go-shellwords v1.0.12
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/kvproto v0.0.0-20250117013947-1fdf41372412
github.com/pingcap/kvproto v0.0.0-20250117122752-2b87602a94a1
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/common v0.55.0
Expand Down
Loading

0 comments on commit 54b9646

Please sign in to comment.