Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#58054
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
MyonKeminta authored and ti-chi-bot committed Jan 14, 2025
1 parent 3029ea6 commit 18b5df5
Show file tree
Hide file tree
Showing 23 changed files with 264 additions and 48 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 = "587d22d21daa1f44b18b0c2325fcb4233af71a985f397a36aa9db8796777b8f2",
strip_prefix = "github.com/tikv/client-go/v2@v2.0.8-0.20241212025239-0dc41295f929",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241212025239-0dc41295f929.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241212025239-0dc41295f929.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241212025239-0dc41295f929.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241212025239-0dc41295f929.zip",
=======
sha256 = "844684ee6ae7decc5cadcab3f95c526b66878f8401c71cf82af68ec0cc5257d5",
strip_prefix = "github.com/tikv/client-go/v2@v2.0.8-0.20241209094930-06d7f4b9233b",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241209094930-06d7f4b9233b.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241209094930-06d7f4b9233b.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241209094930-06d7f4b9233b.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241209094930-06d7f4b9233b.zip",
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
],
)
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.20241212025239-0dc41295f929
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.20241209094930-06d7f4b9233b
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
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.20241212025239-0dc41295f929 h1:dvY5kl35L+aroDl3HQzOx4J7N6sdd8TiXEV+GhNemtU=
github.com/tikv/client-go/v2 v2.0.8-0.20241212025239-0dc41295f929/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.20241209094930-06d7f4b9233b h1:x8E2J8UuUa2ysUkgVfNGgiXxZ9nfqBpQ43PBLwmCitU=
github.com/tikv/client-go/v2 v2.0.8-0.20241209094930-06d7f4b9233b/go.mod h1:NI2GfVlB9n7DsIGCxrKcD4psrcuFNEV8m1BgyzK1Amc=
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31 h1:oAYc4m5Eu1OY9ogJ103VO47AYPHvhtzbUPD8L8B67Qk=
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31/go.mod h1:W5a0sDadwUpI9k8p7M77d3jo253ZHdmua+u4Ho4Xw8U=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
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
56 changes: 51 additions & 5 deletions pkg/ddl/column_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/pingcap/tidb/pkg/testkit"
"github.com/pingcap/tidb/pkg/testkit/external"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/mock"
"github.com/stretchr/testify/require"
)

Expand All @@ -48,10 +47,14 @@ func TestColumnAdd(t *testing.T) {
tk.MustExec("create table t (c1 int, c2 int);")
tk.MustExec("insert t values (1, 2);")

<<<<<<< HEAD
d := dom.DDL()
tc := &callback.TestDDLCallback{Do: dom}

ct := testNewContext(store)
=======
ct := testNewContext(t, store)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
// set up hook
var (
deleteOnlyTable table.Table
Expand Down Expand Up @@ -127,8 +130,13 @@ func TestColumnAdd(t *testing.T) {
return
}
first = false
<<<<<<< HEAD
sess := testNewContext(store)
err := sessiontxn.NewTxn(context.Background(), sess)
=======
sess := testNewContext(t, store)
txn, err := newTxn(sess)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
require.NoError(t, err)
_, err = writeOnlyTable.AddRecord(sess, types.MakeDatums(10, 10))
require.NoError(t, err)
Expand Down Expand Up @@ -223,7 +231,15 @@ func checkAddWriteOnly(ctx sessionctx.Context, deleteOnlyTable, writeOnlyTable t
if err != nil {
return errors.Trace(err)
}
<<<<<<< HEAD
err = sessiontxn.NewTxn(context.Background(), ctx)
=======
err = txn.Commit(context.Background())
if err != nil {
return errors.Trace(err)
}
txn, err = newTxn(ctx)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
if err != nil {
return errors.Trace(err)
}
Expand Down Expand Up @@ -261,7 +277,15 @@ func checkAddWriteOnly(ctx sessionctx.Context, deleteOnlyTable, writeOnlyTable t
if err != nil {
return errors.Trace(err)
}
<<<<<<< HEAD
err = sessiontxn.NewTxn(context.Background(), ctx)
=======
err = txn.Commit(context.Background())
if err != nil {
return errors.Trace(err)
}
txn, err = newTxn(ctx)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
if err != nil {
return errors.Trace(err)
}
Expand All @@ -278,7 +302,15 @@ func checkAddWriteOnly(ctx sessionctx.Context, deleteOnlyTable, writeOnlyTable t
if err != nil {
return errors.Trace(err)
}
<<<<<<< HEAD
err = sessiontxn.NewTxn(context.Background(), ctx)
=======
err = txn.Commit(context.Background())
if err != nil {
return errors.Trace(err)
}
_, err = newTxn(ctx)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
if err != nil {
return errors.Trace(err)
}
Expand Down Expand Up @@ -308,7 +340,15 @@ func checkAddPublic(sctx sessionctx.Context, writeOnlyTable, publicTable table.T
if err != nil {
return errors.Trace(err)
}
<<<<<<< HEAD
err = sessiontxn.NewTxn(ctx, sctx)
=======
err = txn.Commit(context.Background())
if err != nil {
return errors.Trace(err)
}
txn, err = newTxn(sctx)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
if err != nil {
return errors.Trace(err)
}
Expand All @@ -325,7 +365,15 @@ func checkAddPublic(sctx sessionctx.Context, writeOnlyTable, publicTable table.T
if err != nil {
return errors.Trace(err)
}
<<<<<<< HEAD
err = sessiontxn.NewTxn(ctx, sctx)
=======
err = txn.Commit(context.Background())
if err != nil {
return errors.Trace(err)
}
_, err = newTxn(sctx)
>>>>>>> 0bf3e019002 (*: Update client-go and verify all read ts (#58054))
if err != nil {
return errors.Trace(err)
}
Expand Down Expand Up @@ -431,10 +479,8 @@ func testCheckJobDone(t *testing.T, store kv.Storage, jobID int64, isAdd bool) {
}
}

func testNewContext(store kv.Storage) sessionctx.Context {
ctx := mock.NewContext()
ctx.Store = store
return ctx
func testNewContext(t *testing.T, store kv.Storage) sessionctx.Context {
return testkit.NewSession(t, store)
}

func TestIssue40135(t *testing.T) {
Expand Down
Loading

0 comments on commit 18b5df5

Please sign in to comment.