Skip to content

Commit 8e37db5

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 e2da796 commit 8e37db5

File tree

22 files changed

+235
-12
lines changed

22 files changed

+235
-12
lines changed

DEPS.bzl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5650,13 +5650,23 @@ def go_deps():
56505650
name = "com_github_pingcap_kvproto",
56515651
build_file_proto_mode = "disable_global",
56525652
importpath = "github.com/pingcap/kvproto",
5653+
<<<<<<< HEAD
56535654
sha256 = "07dff29e9848e79f36ac8dcd0d5b48bbfbb2796308702451afb862accb79fedb",
56545655
strip_prefix = "github.com/pingcap/[email protected]",
56555656
urls = [
56565657
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240227073058-929ab83f9754.zip",
56575658
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240227073058-929ab83f9754.zip",
56585659
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240227073058-929ab83f9754.zip",
56595660
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240227073058-929ab83f9754.zip",
5661+
=======
5662+
sha256 = "d470ef683433f2c5bc7a1e610da44d516908d326a0341c07208af76a30f0d8a6",
5663+
strip_prefix = "github.com/pingcap/[email protected]",
5664+
urls = [
5665+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
5666+
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
5667+
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
5668+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
5669+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
56605670
],
56615671
)
56625672
go_repository(
@@ -6807,13 +6817,23 @@ def go_deps():
68076817
name = "com_github_tikv_client_go_v2",
68086818
build_file_proto_mode = "disable_global",
68096819
importpath = "github.com/tikv/client-go/v2",
6820+
<<<<<<< HEAD
68106821
sha256 = "6701afd9ef373b22010ff1c3aeb91fca8a6165341c6a38dd31a00ed10d24f314",
68116822
strip_prefix = "github.com/tikv/client-go/[email protected]",
68126823
urls = [
68136824
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240913090512-3777c384feb1.zip",
68146825
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240913090512-3777c384feb1.zip",
68156826
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240913090512-3777c384feb1.zip",
68166827
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240913090512-3777c384feb1.zip",
6828+
=======
6829+
sha256 = "4bc779621156c4ee6f46b57235da9c34c8ec0ee6d3be5f52e33da4c47098eeed",
6830+
strip_prefix = "github.com/tikv/client-go/[email protected]",
6831+
urls = [
6832+
"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",
6833+
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
6834+
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
6835+
"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",
6836+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
68176837
],
68186838
)
68196839
go_repository(

errors.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,6 +2136,11 @@ error = '''
21362136
not implemented
21372137
'''
21382138

2139+
["kv:8178"]
2140+
error = '''
2141+
key is too large, the size of given key is %d
2142+
'''
2143+
21392144
["kv:9007"]
21402145
error = '''
21412146
Write conflict, txnStartTS=%d, conflictStartTS=%d, conflictCommitTS=%d, key=%s%s%s%s, reason=%s [try again later]

go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ require (
8484
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f
8585
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
8686
github.com/pingcap/fn v1.0.0
87+
<<<<<<< HEAD
8788
github.com/pingcap/kvproto v0.0.0-20240227073058-929ab83f9754
89+
=======
90+
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302
91+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
8892
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d
8993
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
9094
github.com/pingcap/tidb/pkg/parser v0.0.0-20211011031125-9b13dc409c5e
@@ -106,8 +110,13 @@ require (
106110
github.com/tdakkota/asciicheck v0.2.0
107111
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
108112
github.com/tidwall/btree v1.7.0
113+
<<<<<<< HEAD
109114
github.com/tikv/client-go/v2 v2.0.8-0.20240913090512-3777c384feb1
110115
github.com/tikv/pd/client v0.0.0-20240806105739-10ecdbe92b55
116+
=======
117+
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b
118+
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31
119+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
111120
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
112121
github.com/twmb/murmur3 v1.1.6
113122
github.com/uber/jaeger-client-go v2.22.1+incompatible

go.sum

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,13 @@ github.com/pingcap/fn v1.0.0/go.mod h1:u9WZ1ZiOD1RpNhcI42RucFh/lBuzTu6rw88a+oF2Z
638638
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=
639639
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
640640
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
641+
<<<<<<< HEAD
641642
github.com/pingcap/kvproto v0.0.0-20240227073058-929ab83f9754 h1:nU9wDeMsID8EWawRQVdmRYcNhUrlI4TKogZhXleG4QQ=
642643
github.com/pingcap/kvproto v0.0.0-20240227073058-929ab83f9754/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
644+
=======
645+
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302 h1:ynwwqr0rLliSOJcx0wHMu4T/NiPXHlK48mk2DCrBKCI=
646+
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
647+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
643648
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM=
644649
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
645650
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d h1:y3EueKVfVykdpTyfUnQGqft0ud+xVFuCdp1XkVL0X1E=
@@ -783,10 +788,17 @@ github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW
783788
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM=
784789
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
785790
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
791+
<<<<<<< HEAD
786792
github.com/tikv/client-go/v2 v2.0.8-0.20240913090512-3777c384feb1 h1:KmLTcRXq+sMZ5tKKLLX6H+bs1fUQB6uYaRg52Wkt6n0=
787793
github.com/tikv/client-go/v2 v2.0.8-0.20240913090512-3777c384feb1/go.mod h1:+vXk4Aex17GnI8gfSMPxrL0SQLbBYgP3Db4FvHiImwM=
788794
github.com/tikv/pd/client v0.0.0-20240806105739-10ecdbe92b55 h1:+1unfy0TcJJtud3d7BuYsvNG6tPVuXIH+WiIFhOx1Kc=
789795
github.com/tikv/pd/client v0.0.0-20240806105739-10ecdbe92b55/go.mod h1:1zqLOMhnkZIpBLj2oXOO2bWvtXhb12OmYr+cPkjQ6tI=
796+
=======
797+
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b h1:/hmt2FCt34rCVBX9dswiSdHOkppP67VWaESryTxDKc8=
798+
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b/go.mod h1:NI2GfVlB9n7DsIGCxrKcD4psrcuFNEV8m1BgyzK1Amc=
799+
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31 h1:oAYc4m5Eu1OY9ogJ103VO47AYPHvhtzbUPD8L8B67Qk=
800+
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31/go.mod h1:W5a0sDadwUpI9k8p7M77d3jo253ZHdmua+u4Ho4Xw8U=
801+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
790802
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
791803
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
792804
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=

pkg/errno/errcode.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,11 @@ const (
10841084
ErrBRJobNotFound = 8174
10851085
ErrMemoryExceedForQuery = 8175
10861086
ErrMemoryExceedForInstance = 8176
1087+
<<<<<<< HEAD
1088+
=======
1089+
ErrDeleteNotFoundColumn = 8177
1090+
ErrKeyTooLarge = 8178
1091+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
10871092

10881093
// Error codes used by TiDB ddl package
10891094
ErrUnsupportedDDLOperation = 8200

pkg/errno/errname.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,14 @@ var MySQLErrName = map[uint16]*mysql.ErrMessage{
10771077
ErrLoadDataPreCheckFailed: mysql.Message("PreCheck failed: %s", nil),
10781078
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),
10791079
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),
1080+
<<<<<<< HEAD
10801081
ErrHTTPServiceError: mysql.Message("HTTP request failed with status %s", nil),
1082+
=======
1083+
ErrDeleteNotFoundColumn: mysql.Message("Delete can not find column %s for table %s", nil),
1084+
ErrKeyTooLarge: mysql.Message("key is too large, the size of given key is %d", nil),
1085+
1086+
ErrHTTPServiceError: mysql.Message("HTTP request failed with status %s", nil),
1087+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
10811088

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

pkg/executor/adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ func (a *ExecStmt) handleStmtForeignKeyTrigger(ctx context.Context, e exec.Execu
603603
if stmtCtx.ForeignKeyTriggerCtx.HasFKCascades {
604604
// If the ExecStmt has foreign key cascade to be executed, we need call `StmtCommit` to commit the ExecStmt itself
605605
// change first.
606-
// Since `UnionScanExec` use `SnapshotIter` and `SnapshotGetter` to read txn mem-buffer, if we don't do `StmtCommit`,
606+
// Since `UnionScanExec` use `SnapshotIter` and `SnapshotGetter` to read txn mem-buffer, if we don't do `StmtCommit`,
607607
// then the fk cascade executor can't read the mem-buffer changed by the ExecStmt.
608608
a.Ctx.StmtCommit(ctx)
609609
}

pkg/executor/executor_pkg_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ func TestBuildKvRangesForIndexJoinWithoutCwcAndWithMemoryTracker(t *testing.T) {
130130
}
131131

132132
require.Equal(t, 2*bytesConsumed1, bytesConsumed2)
133+
<<<<<<< HEAD
133134
require.Equal(t, int64(20760), bytesConsumed1)
135+
=======
136+
require.Equal(t, int64(23640), bytesConsumed1)
137+
>>>>>>> e234164d7cd (*: bump client-go with some regression tests (#57282))
134138
}
135139

136140
func generateIndexRange(vals ...int64) *ranger.Range {

pkg/executor/mem_reader.go

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ func (iter *txnMemBufferIter) Valid() bool {
321321
if iter.curr.Valid() {
322322
return true
323323
}
324-
iter.curr = nil
325324
iter.idx++
326325
}
327326
for iter.idx < len(iter.kvRanges) {
@@ -348,7 +347,6 @@ func (iter *txnMemBufferIter) Valid() bool {
348347
if iter.curr.Valid() {
349348
return true
350349
}
351-
iter.curr = nil
352350
iter.idx++
353351
}
354352
return false
@@ -374,7 +372,10 @@ func (iter *txnMemBufferIter) Value() []byte {
374372
return iter.curr.Value()
375373
}
376374

377-
func (*txnMemBufferIter) Close() {
375+
func (iter *txnMemBufferIter) Close() {
376+
if iter.curr != nil {
377+
iter.curr.Close()
378+
}
378379
}
379380

380381
func (m *memTableReader) getMemRowsIter(ctx context.Context) (memRowsIter, error) {
@@ -855,6 +856,8 @@ func buildMemIndexMergeReader(ctx context.Context, us *UnionScanExec, indexMerge
855856

856857
type memRowsIter interface {
857858
Next() ([]types.Datum, error)
859+
// Close will release the snapshot it holds, so be sure to call Close.
860+
Close()
858861
}
859862

860863
type defaultRowsIter struct {
@@ -871,6 +874,8 @@ func (iter *defaultRowsIter) Next() ([]types.Datum, error) {
871874
return nil, nil
872875
}
873876

877+
func (*defaultRowsIter) Close() {}
878+
874879
// memRowsIterForTable combine a kv.Iterator and a kv decoder to get a memRowsIter.
875880
type memRowsIterForTable struct {
876881
kvIter *txnMemBufferIter // txnMemBufferIter is the kv.Iterator
@@ -939,6 +944,12 @@ func (iter *memRowsIterForTable) Next() ([]types.Datum, error) {
939944
return ret, nil
940945
}
941946

947+
func (iter *memRowsIterForTable) Close() {
948+
if iter.kvIter != nil {
949+
iter.kvIter.Close()
950+
}
951+
}
952+
942953
type memRowsIterForIndex struct {
943954
kvIter *txnMemBufferIter
944955
tps []*types.FieldType
@@ -980,6 +991,12 @@ func (iter *memRowsIterForIndex) Next() ([]types.Datum, error) {
980991
return ret, nil
981992
}
982993

994+
func (iter *memRowsIterForIndex) Close() {
995+
if iter.kvIter != nil {
996+
iter.kvIter.Close()
997+
}
998+
}
999+
9831000
func (m *memIndexMergeReader) getMemRowsIter(ctx context.Context) (memRowsIter, error) {
9841001
data, err := m.getMemRows(ctx)
9851002
if err != nil {

pkg/executor/union_scan.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ func (us *UnionScanExec) Close() error {
188188
us.cursor4AddRows = nil
189189
us.cursor4SnapshotRows = 0
190190
us.snapshotRows = us.snapshotRows[:0]
191+
if us.addedRowsIter != nil {
192+
us.addedRowsIter.Close()
193+
}
191194
return exec.Close(us.Children(0))
192195
}
193196

0 commit comments

Comments
 (0)