Skip to content

Commit 91436c8

Browse files
you06ti-chi-bot
authored andcommitted
This is an automated cherry-pick of pingcap#57282
Signed-off-by: ti-chi-bot <[email protected]>
1 parent f00a584 commit 91436c8

File tree

22 files changed

+4082
-4
lines changed

22 files changed

+4082
-4
lines changed

DEPS.bzl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,8 +3420,19 @@ def go_deps():
34203420
name = "com_github_pingcap_kvproto",
34213421
build_file_proto_mode = "disable_global",
34223422
importpath = "github.com/pingcap/kvproto",
3423+
<<<<<<< HEAD
34233424
sum = "h1:so6ffMPEx9HYGOOi9T0ezTZlI7LvpYBUQyWWyz8kND8=",
34243425
version = "v0.0.0-20231011074246-fa00d2b03372",
3426+
=======
3427+
sha256 = "d470ef683433f2c5bc7a1e610da44d516908d326a0341c07208af76a30f0d8a6",
3428+
strip_prefix = "github.com/pingcap/[email protected]",
3429+
urls = [
3430+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
3431+
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
3432+
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
3433+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
3434+
],
3435+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
34253436
)
34263437
go_repository(
34273438
name = "com_github_pingcap_log",
@@ -4179,8 +4190,19 @@ def go_deps():
41794190
name = "com_github_tikv_client_go_v2",
41804191
build_file_proto_mode = "disable_global",
41814192
importpath = "github.com/tikv/client-go/v2",
4193+
<<<<<<< HEAD
41824194
sum = "h1:DeZMstuDPx80CNsJdmN47biH+8PL5qK4TmTyNcDRDdI=",
41834195
version = "v2.0.8-0.20241111142004-e10335846244",
4196+
=======
4197+
sha256 = "4bc779621156c4ee6f46b57235da9c34c8ec0ee6d3be5f52e33da4c47098eeed",
4198+
strip_prefix = "github.com/tikv/client-go/[email protected]",
4199+
urls = [
4200+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
4201+
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
4202+
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
4203+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
4204+
],
4205+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
41844206
)
41854207
go_repository(
41864208
name = "com_github_tikv_pd",

errno/errcode.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,14 @@ const (
10631063
ErrLoadDataInvalidOperation = 8171
10641064
ErrLoadDataLocalUnsupportedOption = 8172
10651065
ErrLoadDataPreCheckFailed = 8173
1066+
<<<<<<< HEAD:errno/errcode.go
1067+
=======
1068+
ErrBRJobNotFound = 8174
1069+
ErrMemoryExceedForQuery = 8175
1070+
ErrMemoryExceedForInstance = 8176
1071+
ErrDeleteNotFoundColumn = 8177
1072+
ErrKeyTooLarge = 8178
1073+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282)):pkg/errno/errcode.go
10661074

10671075
// Error codes used by TiDB ddl package
10681076
ErrUnsupportedDDLOperation = 8200

errno/errname.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,15 @@ var MySQLErrName = map[uint16]*mysql.ErrMessage{
10561056
ErrLoadDataInvalidOperation: mysql.Message("The current job status cannot perform the operation. %s", nil),
10571057
ErrLoadDataLocalUnsupportedOption: mysql.Message("Unsupported option for LOAD DATA LOCAL INFILE: %s", nil),
10581058
ErrLoadDataPreCheckFailed: mysql.Message("PreCheck failed: %s", nil),
1059+
<<<<<<< HEAD:errno/errname.go
1060+
=======
1061+
ErrMemoryExceedForQuery: mysql.Message("Your query has been cancelled due to exceeding the allowed memory limit for a single SQL query. Please try narrowing your query scope or increase the tidb_mem_quota_query limit and try again.[conn=%d]", nil),
1062+
ErrMemoryExceedForInstance: mysql.Message("Your query has been cancelled due to exceeding the allowed memory limit for the tidb-server instance and this query is currently using the most memory. Please try narrowing your query scope or increase the tidb_server_memory_limit and try again.[conn=%d]", nil),
1063+
ErrDeleteNotFoundColumn: mysql.Message("Delete can not find column %s for table %s", nil),
1064+
ErrKeyTooLarge: mysql.Message("key is too large, the size of given key is %d", nil),
1065+
1066+
ErrHTTPServiceError: mysql.Message("HTTP request failed with status %s", nil),
1067+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282)):pkg/errno/errname.go
10591068

10601069
ErrWarnOptimizerHintInvalidInteger: mysql.Message("integer value is out of range in '%s'", nil),
10611070
ErrWarnOptimizerHintUnsupportedHint: mysql.Message("Optimizer hint %s is not supported by TiDB and is ignored", nil),

errors.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,11 @@ error = '''
19811981
not implemented
19821982
'''
19831983

1984+
["kv:8178"]
1985+
error = '''
1986+
key is too large, the size of given key is %d
1987+
'''
1988+
19841989
["kv:9007"]
19851990
error = '''
19861991
Write conflict, txnStartTS=%d, conflictStartTS=%d, conflictCommitTS=%d, key=%s%s%s%s, reason=%s [try again later]

executor/adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ func (a *ExecStmt) handleStmtForeignKeyTrigger(ctx context.Context, e Executor)
590590
if stmtCtx.ForeignKeyTriggerCtx.HasFKCascades {
591591
// If the ExecStmt has foreign key cascade to be executed, we need call `StmtCommit` to commit the ExecStmt itself
592592
// change first.
593-
// Since `UnionScanExec` use `SnapshotIter` and `SnapshotGetter` to read txn mem-buffer, if we don't do `StmtCommit`,
593+
// Since `UnionScanExec` use `SnapshotIter` and `SnapshotGetter` to read txn mem-buffer, if we don't do `StmtCommit`,
594594
// then the fk cascade executor can't read the mem-buffer changed by the ExecStmt.
595595
a.Ctx.StmtCommit(ctx)
596596
}

executor/union_scan.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,14 @@ func (us *UnionScanExec) Close() error {
187187
us.cursor4SnapshotRows = 0
188188
us.addedRows = us.addedRows[:0]
189189
us.snapshotRows = us.snapshotRows[:0]
190+
<<<<<<< HEAD:executor/union_scan.go
190191
return us.children[0].Close()
192+
=======
193+
if us.addedRowsIter != nil {
194+
us.addedRowsIter.Close()
195+
}
196+
return exec.Close(us.Children(0))
197+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282)):pkg/executor/union_scan.go
191198
}
192199

193200
// getOneRow gets one result row from dirty table or child.

go.mod

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ require (
6969
github.com/opentracing/basictracer-go v1.0.0
7070
github.com/opentracing/opentracing-go v1.2.0
7171
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
72+
<<<<<<< HEAD
7273
github.com/pingcap/badger v1.5.1-0.20230103063557-828f39b09b6d
7374
github.com/pingcap/errors v0.11.5-0.20231212100244-799fae176cfb
7475
github.com/pingcap/failpoint v0.0.0-20240527053858-9b3b6e34194a
@@ -85,6 +86,25 @@ require (
8586
github.com/prometheus/prometheus v0.0.0-20190525122359-d20e84d0fb64
8687
github.com/sasha-s/go-deadlock v0.2.0
8788
github.com/shirou/gopsutil/v3 v3.23.3
89+
=======
90+
github.com/pingcap/badger v1.5.1-0.20241015064302-38533b6cbf8d
91+
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f
92+
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
93+
github.com/pingcap/fn v1.0.0
94+
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302
95+
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d
96+
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
97+
github.com/pingcap/tidb/pkg/parser v0.0.0-20211011031125-9b13dc409c5e
98+
github.com/pingcap/tipb v0.0.0-20241022082558-0607513e7fa4
99+
github.com/prometheus/client_golang v1.20.5
100+
github.com/prometheus/client_model v0.6.1
101+
github.com/prometheus/common v0.57.0
102+
github.com/prometheus/prometheus v0.50.1
103+
github.com/qri-io/jsonschema v0.2.1
104+
github.com/robfig/cron/v3 v3.0.1
105+
github.com/sasha-s/go-deadlock v0.3.5
106+
github.com/shirou/gopsutil/v3 v3.24.5
107+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
88108
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0
89109
github.com/soheilhy/cmux v0.1.5
90110
github.com/spf13/cobra v1.6.1
@@ -94,9 +114,16 @@ require (
94114
github.com/stretchr/testify v1.8.2
95115
github.com/tdakkota/asciicheck v0.2.0
96116
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
117+
<<<<<<< HEAD
97118
github.com/tikv/client-go/v2 v2.0.8-0.20241111142004-e10335846244
98119
github.com/tikv/pd/client v0.0.0-20240725070735-fb162bf0aa3f
99120
github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e
121+
=======
122+
github.com/tidwall/btree v1.7.0
123+
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b
124+
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31
125+
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
126+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
100127
github.com/twmb/murmur3 v1.1.6
101128
github.com/uber/jaeger-client-go v2.22.1+incompatible
102129
github.com/vbauerster/mpb/v7 v7.5.3

go.sum

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,14 @@ github.com/pingcap/fn v0.0.0-20200306044125-d5540d389059/go.mod h1:fMRU1BA1y+r89
789789
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=
790790
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
791791
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
792+
<<<<<<< HEAD
792793
github.com/pingcap/kvproto v0.0.0-20231011074246-fa00d2b03372 h1:so6ffMPEx9HYGOOi9T0ezTZlI7LvpYBUQyWWyz8kND8=
793794
github.com/pingcap/kvproto v0.0.0-20231011074246-fa00d2b03372/go.mod h1:guCyM5N+o+ru0TsoZ1hi9lDjUMs2sIBjW3ARTEpVbnk=
794795
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
796+
=======
797+
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302 h1:ynwwqr0rLliSOJcx0wHMu4T/NiPXHlK48mk2DCrBKCI=
798+
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
799+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
795800
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM=
796801
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
797802
github.com/pingcap/log v1.1.1-0.20230317032135-a0d097d16e22 h1:2SOzvGvE8beiC1Y4g9Onkvu6UmuBBOeWRGQEjJaT/JY=
@@ -968,12 +973,23 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJf
968973
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU=
969974
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4=
970975
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM=
976+
<<<<<<< HEAD
971977
github.com/tikv/client-go/v2 v2.0.8-0.20241111142004-e10335846244 h1:DeZMstuDPx80CNsJdmN47biH+8PL5qK4TmTyNcDRDdI=
972978
github.com/tikv/client-go/v2 v2.0.8-0.20241111142004-e10335846244/go.mod h1:45NuHB8x+VAoztMIjF6hEgXvPQXhXWPfMxDg0N8CoRY=
973979
github.com/tikv/pd/client v0.0.0-20240725070735-fb162bf0aa3f h1:Szw9YxqGGEneSniBd4ep09jgB77cKUy+AuhKOmdGPdE=
974980
github.com/tikv/pd/client v0.0.0-20240725070735-fb162bf0aa3f/go.mod h1:QCBn54O5lhfkYfxj8Tyiqaxue/mthHEMyi7AqJP/+n4=
975981
github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo=
976982
github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ=
983+
=======
984+
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
985+
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
986+
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b h1:/hmt2FCt34rCVBX9dswiSdHOkppP67VWaESryTxDKc8=
987+
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b/go.mod h1:NI2GfVlB9n7DsIGCxrKcD4psrcuFNEV8m1BgyzK1Amc=
988+
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31 h1:oAYc4m5Eu1OY9ogJ103VO47AYPHvhtzbUPD8L8B67Qk=
989+
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31/go.mod h1:W5a0sDadwUpI9k8p7M77d3jo253ZHdmua+u4Ho4Xw8U=
990+
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
991+
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
992+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
977993
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
978994
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
979995
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=

kv/error.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ var (
4747
ErrTxnTooLarge = dbterror.ClassKV.NewStd(mysql.ErrTxnTooLarge)
4848
// ErrEntryTooLarge is the error when a key value entry is too large.
4949
ErrEntryTooLarge = dbterror.ClassKV.NewStd(mysql.ErrEntryTooLarge)
50+
<<<<<<< HEAD:kv/error.go
5051
// ErrKeyExists returns when key is already exist.
52+
=======
53+
// ErrKeyTooLarge is the error when a key is too large to be handled by MemBuffer.
54+
ErrKeyTooLarge = dbterror.ClassKV.NewStd(mysql.ErrKeyTooLarge)
55+
// ErrKeyExists returns when key is already exist. Caller should try to use
56+
// GenKeyExistsErr to generate this error for correct format.
57+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282)):pkg/kv/error.go
5158
ErrKeyExists = dbterror.ClassKV.NewStd(mysql.ErrDupEntry)
5259
// ErrNotImplemented returns when a function is not implemented yet.
5360
ErrNotImplemented = dbterror.ClassKV.NewStd(mysql.ErrNotImplemented)

kv/key.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,23 @@ func (k Key) String() string {
9696
type KeyRange struct {
9797
StartKey Key
9898
EndKey Key
99+
}
100+
101+
<<<<<<< HEAD:kv/key.go
102+
=======
103+
// KeyRangeSliceMemUsage return the memory usage of []KeyRange
104+
func KeyRangeSliceMemUsage(k []KeyRange) int64 {
105+
const sizeofKeyRange = int64(unsafe.Sizeof(*(*KeyRange)(nil)))
106+
107+
res := sizeofKeyRange * int64(cap(k))
108+
for _, m := range k {
109+
res += int64(cap(m.StartKey)) + int64(cap(m.EndKey))
110+
}
99111

100-
XXXNoUnkeyedLiteral struct{}
101-
XXXunrecognized []byte
102-
XXXsizecache int32
112+
return res
103113
}
104114

115+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282)):pkg/kv/key.go
105116
// IsPoint checks if the key range represents a point.
106117
func (r *KeyRange) IsPoint() bool {
107118
if len(r.StartKey) != len(r.EndKey) {

0 commit comments

Comments
 (0)