From bff23d7eb34e24e6b40c752a8c2709c10cd2bba2 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Mon, 26 Sep 2022 22:14:58 +0800 Subject: [PATCH 1/3] *: enable race for tidb-server Signed-off-by: Weizhen Wang --- tidb-server/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/tidb-server/BUILD.bazel b/tidb-server/BUILD.bazel index b455a2276c655..9131cab149b9f 100644 --- a/tidb-server/BUILD.bazel +++ b/tidb-server/BUILD.bazel @@ -66,6 +66,7 @@ go_binary( name = "tidb-server", embed = [":tidb-server_lib"], visibility = ["//visibility:public"], + race = "on", x_defs = { "github.com/pingcap/tidb/parser/mysql.TiDBReleaseVersion": "{STABLE_TiDB_RELEASE_VERSION}", "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS": "{STABLE_TiDB_BUILD_UTCTIME}", From a0b3c5081201ae43e20b39f8389fa996a15493aa Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Tue, 27 Sep 2022 23:46:29 +0800 Subject: [PATCH 2/3] *: enable race for tidb-server Signed-off-by: Weizhen Wang --- executor/table_reader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/executor/table_reader.go b/executor/table_reader.go index fd162a63bfca9..7aed132691804 100644 --- a/executor/table_reader.go +++ b/executor/table_reader.go @@ -27,6 +27,7 @@ import ( "github.com/pingcap/tidb/parser/model" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/sessionctx" + "github.com/pingcap/tidb/sessiontxn" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" @@ -418,7 +419,7 @@ func (e *TableReaderExecutor) buildKVReq(ctx context.Context, ranges []*ranger.R SetReadReplicaScope(e.readReplicaScope). SetIsStaleness(e.isStaleness). SetFromSessionVars(e.ctx.GetSessionVars()). - SetFromInfoSchema(e.ctx.GetInfoSchema()). + SetFromInfoSchema(sessiontxn.GetTxnManager(e.ctx).GetTxnInfoSchema()). SetMemTracker(e.memTracker). SetStoreType(e.storeType). SetAllowBatchCop(e.batchCop). From 197a5e514dbe735e0533600fc16a52c34b749bea Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 28 Sep 2022 12:21:23 +0800 Subject: [PATCH 3/3] clean code Signed-off-by: Weizhen Wang --- tidb-server/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/tidb-server/BUILD.bazel b/tidb-server/BUILD.bazel index 9131cab149b9f..b455a2276c655 100644 --- a/tidb-server/BUILD.bazel +++ b/tidb-server/BUILD.bazel @@ -66,7 +66,6 @@ go_binary( name = "tidb-server", embed = [":tidb-server_lib"], visibility = ["//visibility:public"], - race = "on", x_defs = { "github.com/pingcap/tidb/parser/mysql.TiDBReleaseVersion": "{STABLE_TiDB_RELEASE_VERSION}", "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS": "{STABLE_TiDB_BUILD_UTCTIME}",