Skip to content
Open
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
12 changes: 6 additions & 6 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3519,8 +3519,8 @@ def go_deps():
name = "com_github_pingcap_kvproto",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/kvproto",
sum = "h1:fnagXtVQTLmi2sLH7QgvH1vHlFohDeQtRASxzXVk2ss=",
version = "v0.0.0-20260703015547-e800f9e5a427",
sum = "h1:PJIfTrhcVitRq5nJmzTDCV75YpaDJc+YKMtqgyBfH84=",
version = "v0.0.0-20260716111302-363178052f57",
)
go_repository(
name = "com_github_pingcap_log",
Expand Down Expand Up @@ -4206,16 +4206,16 @@ def go_deps():
build_tags = ["nextgen", "intest"],
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sum = "h1:fjOCdCmNgUrRzwOlemKHnCItUorHKbNvYRxdXlr7KCc=",
version = "v2.0.8-0.20260617064024-5526ae2a8546",
sum = "h1:RSzuwb/YdgiMPQO7dRZ8ilE71YL4n03nGU9qrCXDZEg=",
version = "v2.0.8-0.20260716132210-520a5635e5e3",
)
go_repository(
name = "com_github_tikv_pd_client",
build_tags = ["nextgen", "intest"],
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/pd/client",
sum = "h1:8oHjHFQea2yL+MUK6Z6d1p0dYI2rHkoCQVjw1Yo6Uss=",
version = "v0.0.0-20260714045825-19ee324ee9d8",
sum = "h1:Bk296Skcn1GfRARDmYAuGONfnybon7ZntmCTrlCnzpQ=",
version = "v0.0.0-20260716095117-1636e69a936b",
)
go_repository(
name = "com_github_timakin_bodyclose",
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ require (
github.com/pingcap/errors v0.11.5-0.20260508054701-306e305bcf41
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/fn v1.0.0
github.com/pingcap/kvproto v0.0.0-20260703015547-e800f9e5a427
github.com/pingcap/kvproto v0.0.0-20260716111302-363178052f57
github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9
github.com/pingcap/metering_sdk v0.0.0-20260324055927-14fead745f1d
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
Expand All @@ -123,8 +123,8 @@ require (
github.com/stathat/consistent v1.0.0
github.com/stretchr/testify v1.11.1
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tikv/client-go/v2 v2.0.8-0.20260617064024-5526ae2a8546
github.com/tikv/pd/client v0.0.0-20260714045825-19ee324ee9d8
github.com/tikv/client-go/v2 v2.0.8-0.20260716132210-520a5635e5e3
github.com/tikv/pd/client v0.0.0-20260716095117-1636e69a936b
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
16 changes: 6 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,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-20260610100801-904083a187d5 h1:OgjuwE14rgqWIPSMyPvR4fMI9zA3TB7DZ535w/58yk4=
github.com/pingcap/kvproto v0.0.0-20260610100801-904083a187d5/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
github.com/pingcap/kvproto v0.0.0-20260703015547-e800f9e5a427 h1:fnagXtVQTLmi2sLH7QgvH1vHlFohDeQtRASxzXVk2ss=
github.com/pingcap/kvproto v0.0.0-20260703015547-e800f9e5a427/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
github.com/pingcap/kvproto v0.0.0-20260716111302-363178052f57 h1:PJIfTrhcVitRq5nJmzTDCV75YpaDJc+YKMtqgyBfH84=
github.com/pingcap/kvproto v0.0.0-20260716111302-363178052f57/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.20250917021125-19901e015dc9 h1:qG9BSvlWFEE5otQGamuWedx9LRm0nrHvsQRQiW8SxEs=
Expand Down Expand Up @@ -895,12 +893,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.20260617064024-5526ae2a8546 h1:fjOCdCmNgUrRzwOlemKHnCItUorHKbNvYRxdXlr7KCc=
github.com/tikv/client-go/v2 v2.0.8-0.20260617064024-5526ae2a8546/go.mod h1:WDAIZI2EmfkDX4BP947c5wXJiIM3GgTnaaCp3TqReBE=
github.com/tikv/pd/client v0.0.0-20260611063303-491a11c2f061 h1:G0s09nW/KYlNi17A5rp2EJ1lBTZsQXcH1qpptejC/5E=
github.com/tikv/pd/client v0.0.0-20260611063303-491a11c2f061/go.mod h1:/AgomU1MKQ1LV0kYcvfLrTX/Prn1jLekzvtRNCqNiO4=
github.com/tikv/pd/client v0.0.0-20260714045825-19ee324ee9d8 h1:8oHjHFQea2yL+MUK6Z6d1p0dYI2rHkoCQVjw1Yo6Uss=
github.com/tikv/pd/client v0.0.0-20260714045825-19ee324ee9d8/go.mod h1:UL+x0aP+9+BDig+LYZFIU1G5r/gH2fEsVKl5MTS1Ud8=
github.com/tikv/client-go/v2 v2.0.8-0.20260716132210-520a5635e5e3 h1:RSzuwb/YdgiMPQO7dRZ8ilE71YL4n03nGU9qrCXDZEg=
github.com/tikv/client-go/v2 v2.0.8-0.20260716132210-520a5635e5e3/go.mod h1:0IJooYYDE5i4jKOug+hnphJrmrFORf3VgwfpDWsQoTQ=
github.com/tikv/pd/client v0.0.0-20260716095117-1636e69a936b h1:Bk296Skcn1GfRARDmYAuGONfnybon7ZntmCTrlCnzpQ=
github.com/tikv/pd/client v0.0.0-20260716095117-1636e69a936b/go.mod h1:5xk417Ar8t3SNWBhEwAJ/uycGmTs8ZUQN3GgdUJRFhE=
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/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
Expand Down
2 changes: 1 addition & 1 deletion pkg/distsql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ go_test(
embed = [":distsql"],
flaky = True,
race = "on",
shard_count = 33,
shard_count = 34,
deps = [
"//pkg/distsql/context",
"//pkg/errctx",
Expand Down
1 change: 1 addition & 0 deletions pkg/distsql/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type DistSQLContext struct {
EnablePaging bool
MinPagingSize int
MaxPagingSize int
PagingSizeBytes int
RequestSourceType string
ExplicitRequestSourceType string
StoreBatchSize int
Expand Down
1 change: 1 addition & 0 deletions pkg/distsql/context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func TestContextDetach(t *testing.T) {
EnablePaging: true,
MinPagingSize: 1,
MaxPagingSize: 1,
PagingSizeBytes: 1,
RequestSourceType: "a",
ExplicitRequestSourceType: "b",
StoreBatchSize: 1,
Expand Down
2 changes: 1 addition & 1 deletion pkg/distsql/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func Select(ctx context.Context, dctx *distsqlctx.DistSQLContext, kvReq *kv.Requ
sqlType: label,
memTracker: kvReq.MemTracker,
storeType: kvReq.StoreType,
paging: kvReq.Paging.Enable,
paging: kvReq.Paging.Enable || kvReq.Paging.PagingSizeBytes > 0,
distSQLConcurrency: kvReq.Concurrency,
}, nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/distsql/request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ func (builder *RequestBuilder) SetFromSessionVars(dctx *distsqlctx.DistSQLContex
builder.SetPaging(dctx.EnablePaging)
builder.Request.Paging.MinPagingSize = uint64(dctx.MinPagingSize)
builder.Request.Paging.MaxPagingSize = uint64(dctx.MaxPagingSize)
builder.Request.Paging.PagingSizeBytes = uint64(dctx.PagingSizeBytes)
}
builder.RequestSource.RequestSourceInternal = dctx.InRestrictedSQL
builder.RequestSource.RequestSourceType = dctx.RequestSourceType
Expand Down
13 changes: 13 additions & 0 deletions pkg/distsql/request_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,19 @@ func TestRequestBuilder8(t *testing.T) {
require.Equal(t, expect, actual)
}

func TestRequestBuilderKeepsPagingSizeBytesWhenPagingDisabled(t *testing.T) {
dctx := NewDistSQLContextForTest()
dctx.EnablePaging = false
dctx.PagingSizeBytes = 4 * 1024 * 1024

actual, err := (&RequestBuilder{}).
SetFromSessionVars(dctx).
Build()
require.NoError(t, err)
require.False(t, actual.Paging.Enable)
require.Equal(t, uint64(4*1024*1024), actual.Paging.PagingSizeBytes)
}

func TestRequestBuilderTiKVClientReadTimeout(t *testing.T) {
dctx := NewDistSQLContextForTest()
dctx.TiKVClientReadTimeout = 100
Expand Down
1 change: 1 addition & 0 deletions pkg/executor/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,7 @@ func (e *IndexLookUpExecutor) buildIndexSelectResultForRange(
if e.indexLookUpPushDown {
// Paging and Cop-cache is not supported in index lookup push down.
builder.Request.Paging.Enable = false
builder.Request.Paging.PagingSizeBytes = 0
builder.Request.Cacheable = false
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/kv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ type Request struct {
// when enabled, this field is adjusted to be max(MaxPagingSize, paging.MinAllowedMaxPagingSize),
// see paging.GrowPagingSize
MaxPagingSize uint64
// PagingSizeBytes is the byte budget per page.
// 0 means disabled (no byte-budget paging).
PagingSizeBytes uint64
}
// RequestSource indicates whether the request is an internal request.
RequestSource util.RequestSource
Expand Down
Loading