Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: bump client-go to fix correctness issue of membuffer snapshot read (#55547) #55626

Merged
Merged
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
4 changes: 2 additions & 2 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3603,8 +3603,8 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sum = "h1:dsB3wb0b7Fs4fhoPutSEW2GgQqPRsYt2lXIP9eRXUVs=",
version = "v2.0.4-0.20240827021516-18287765af05",
sum = "h1:lKLA4jW6wj/A15+sb901WXvGd4xvdGuGDOndtyVTV/8=",
version = "v2.0.4-0.20240910032334-87841020c53e",
)
go_repository(
name = "com_github_tikv_pd_client",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ require (
github.com/stretchr/testify v1.8.4
github.com/tdakkota/asciicheck v0.1.1
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tikv/client-go/v2 v2.0.4-0.20240827021516-18287765af05
github.com/tikv/client-go/v2 v2.0.4-0.20240910032334-87841020c53e
github.com/tikv/pd/client v0.0.0-20230904040343-947701a32c05
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144
github.com/twmb/murmur3 v1.1.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,8 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY=
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJfDRtkanvQPiooDH8HvJ2FBh+iKT/OmiQQ=
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU=
github.com/tikv/client-go/v2 v2.0.4-0.20240827021516-18287765af05 h1:dsB3wb0b7Fs4fhoPutSEW2GgQqPRsYt2lXIP9eRXUVs=
github.com/tikv/client-go/v2 v2.0.4-0.20240827021516-18287765af05/go.mod h1:mmVCLP2OqWvQJPOIevQPZvGphzh/oq9vv8J5LDfpadQ=
github.com/tikv/client-go/v2 v2.0.4-0.20240910032334-87841020c53e h1:lKLA4jW6wj/A15+sb901WXvGd4xvdGuGDOndtyVTV/8=
github.com/tikv/client-go/v2 v2.0.4-0.20240910032334-87841020c53e/go.mod h1:mmVCLP2OqWvQJPOIevQPZvGphzh/oq9vv8J5LDfpadQ=
github.com/tikv/pd/client v0.0.0-20230904040343-947701a32c05 h1:e4hLUKfgfPeJPZwOfU+/I/03G0sn6IZqVcbX/5o+hvM=
github.com/tikv/pd/client v0.0.0-20230904040343-947701a32c05/go.mod h1:MLIl+d2WbOF4A3U88WKtyXrQQW417wZDDvBcq2IW9bQ=
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro=
Expand Down
45 changes: 45 additions & 0 deletions session/session_test/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4214,3 +4214,48 @@ func TestPrepareExecuteWithSQLHints(t *testing.T) {
}
}
}

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")
}
Loading