Skip to content

Commit

Permalink
This is an automated cherry-pick of #55547
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
you06 authored and ti-chi-bot committed Sep 25, 2024
1 parent a64e23d commit afc0acd
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7041,13 +7041,23 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
<<<<<<< HEAD
sha256 = "00c96385cb29901a20d4da163038eb5f5e554fca2ec9775f2b87f56a79252d47",
strip_prefix = "github.com/tikv/client-go/v2@v2.0.8-0.20240920100427-3725b31fa3c0",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240920100427-3725b31fa3c0.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240920100427-3725b31fa3c0.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240920100427-3725b31fa3c0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240920100427-3725b31fa3c0.zip",
=======
sha256 = "2c26a7a94e44e2aae520f2013f8d738c5c5f1fb9f70b76894843f6827ce945f7",
strip_prefix = "github.com/tikv/client-go/v2@v2.0.8-0.20240821073530-75e3705e58f1",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240821073530-75e3705e58f1.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240821073530-75e3705e58f1.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240821073530-75e3705e58f1.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240821073530-75e3705e58f1.zip",
>>>>>>> 599977b1d6a (*: bump client-go to fix correctness issue of membuffer snapshot read (#55547))
],
)
go_repository(
Expand Down
7 changes: 7 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,16 @@ require (
github.com/stretchr/testify v1.9.0
github.com/tdakkota/asciicheck v0.2.0
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
<<<<<<< HEAD
github.com/tikv/client-go/v2 v2.0.8-0.20240920100427-3725b31fa3c0
github.com/tikv/pd/client v0.0.0-20240724132535-fcb34c90790c
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966
=======
github.com/tidwall/btree v1.7.0
github.com/tikv/client-go/v2 v2.0.8-0.20240821073530-75e3705e58f1
github.com/tikv/pd/client v0.0.0-20240805092608-838ee7983b78
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
>>>>>>> 599977b1d6a (*: bump client-go to fix correctness issue of membuffer snapshot read (#55547))
github.com/twmb/murmur3 v1.1.6
github.com/uber/jaeger-client-go v2.22.1+incompatible
github.com/vbauerster/mpb/v7 v7.5.3
Expand Down
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -996,12 +996,23 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJf
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU=
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=
<<<<<<< HEAD
github.com/tikv/client-go/v2 v2.0.8-0.20240920100427-3725b31fa3c0 h1:fRrgcL5JMtirxL+gp2/+pB6x1CkAb3kbaI7lnQU7NGI=
github.com/tikv/client-go/v2 v2.0.8-0.20240920100427-3725b31fa3c0/go.mod h1:37p0ryKaieJbBpVDWnaPi2ZS6UFqkgpsemBLkGX2FvM=
github.com/tikv/pd/client v0.0.0-20240724132535-fcb34c90790c h1:oZygf/SCdTUhjoHuZRE85EBgK0oA6LjikpWuJqqjM8U=
github.com/tikv/pd/client v0.0.0-20240724132535-fcb34c90790c/go.mod h1:NW6Af689Jw1FDxjq+WL0nqOdmQ1XT0ly2R1SIKfQuUw=
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M=
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ=
=======
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tikv/client-go/v2 v2.0.8-0.20240821073530-75e3705e58f1 h1:QivCyAQxBOrXWC9X1/yc9U3Hw45usVnicjOg7T/rpgE=
github.com/tikv/client-go/v2 v2.0.8-0.20240821073530-75e3705e58f1/go.mod h1:4HDOAx8OXAJPtqhCZ03IhChXgaFs4B3+vSrPWmiPxjg=
github.com/tikv/pd/client v0.0.0-20240805092608-838ee7983b78 h1:PtW+yTvs9eGTMblulaCHmJ5OtifuE4SJXCACCtkd6ko=
github.com/tikv/pd/client v0.0.0-20240805092608-838ee7983b78/go.mod h1:TxrJRY949Vl14Lmarx6hTNP/HEDYzn4dP0KmjdzQ59w=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
>>>>>>> 599977b1d6a (*: bump client-go to fix correctness issue of membuffer snapshot read (#55547))
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
Expand Down
4 changes: 4 additions & 0 deletions pkg/session/test/txn/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ go_test(
],
flaky = True,
race = "on",
<<<<<<< HEAD
shard_count = 11,
=======
shard_count = 9,
>>>>>>> 599977b1d6a (*: bump client-go to fix correctness issue of membuffer snapshot read (#55547))
deps = [
"//pkg/config",
"//pkg/kv",
Expand Down
46 changes: 46 additions & 0 deletions pkg/session/test/txn/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ func TestInTrans(t *testing.T) {
require.False(t, txn.Valid())
}

<<<<<<< HEAD
func TestCommitRetryCount(t *testing.T) {
store := testkit.CreateMockStore(t)

Expand All @@ -628,4 +629,49 @@ func TestCommitRetryCount(t *testing.T) {

// No auto retry because retry limit is set to 0.
require.Error(t, tk1.ExecToErr("commit"))
=======
func TestMemBufferSnapshotRead(t *testing.T) {
store := testkit.CreateMockStore(t)

tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")

tk.MustExec("drop table if exists t;")
tk.MustExec("create table t(a int primary key, b int, index i(b));")

tk.MustExec("set session tidb_distsql_scan_concurrency = 1;")
tk.MustExec("set session tidb_index_lookup_join_concurrency = 1;")
tk.MustExec("set session tidb_projection_concurrency=1;")
tk.MustExec("set session tidb_init_chunk_size=1;")
tk.MustExec("set session tidb_max_chunk_size=40;")
tk.MustExec("set session tidb_index_join_batch_size = 10")

tk.MustExec("begin;")
// write (0, 0), (1, 1), ... ,(100, 100) into membuffer
var sb strings.Builder
sb.WriteString("insert into t values ")
for i := 0; i <= 100; i++ {
if i > 0 {
sb.WriteString(", ")
}
sb.WriteString(fmt.Sprintf("(%d, %d)", i, i))
}
tk.MustExec(sb.String())

// insert on duplicate key statement should update the table to (0, 100), (1, 99), ... (100, 0)
// This statement will create UnionScan dynamically during execution, and some UnionScan will see staging data(should be bypassed),
// so it relies on correct snapshot read to get the expected result.
tk.MustExec("insert into t (select /*+ INL_JOIN(t1) */ 100 - t1.a as a, t1.b from t t1, (select a, b from t) t2 where t1.b = t2.b) on duplicate key update b = values(b)")

require.Empty(t, tk.MustQuery("select a, b from t where a + b != 100;").Rows())
tk.MustExec("commit;")
require.Empty(t, tk.MustQuery("select a, b from t where a + b != 100;").Rows())

tk.MustExec("set session tidb_distsql_scan_concurrency = default;")
tk.MustExec("set session tidb_index_lookup_join_concurrency = default;")
tk.MustExec("set session tidb_projection_concurrency=default;")
tk.MustExec("set session tidb_init_chunk_size=default;")
tk.MustExec("set session tidb_max_chunk_size=default;")
tk.MustExec("set session tidb_index_join_batch_size = default")
>>>>>>> 599977b1d6a (*: bump client-go to fix correctness issue of membuffer snapshot read (#55547))
}

0 comments on commit afc0acd

Please sign in to comment.