From 07791abecc003f03b085a3a9971a0ba0ef3420bf Mon Sep 17 00:00:00 2001 From: nolouch Date: Fri, 30 Jun 2023 03:47:30 +0800 Subject: [PATCH 1/8] *: customize the request type by sysvar Signed-off-by: nolouch --- distsql/request_builder.go | 1 + go.mod | 2 ++ go.sum | 4 +-- kv/option.go | 4 ++- session/session.go | 1 + session/sessiontest/session_test.go | 36 +++++++++++++++++++ .../sessionstates/session_states_test.go | 12 +++++++ sessionctx/variable/session.go | 2 ++ sessionctx/variable/sysvar.go | 6 ++++ sessionctx/variable/tidb_vars.go | 3 ++ store/copr/coprocessor.go | 2 ++ store/driver/txn/txn_driver.go | 2 ++ 12 files changed, 72 insertions(+), 3 deletions(-) diff --git a/distsql/request_builder.go b/distsql/request_builder.go index a86df57c0763e..b4d0723d9801a 100644 --- a/distsql/request_builder.go +++ b/distsql/request_builder.go @@ -306,6 +306,7 @@ func (builder *RequestBuilder) SetFromSessionVars(sv *variable.SessionVars) *Req } builder.RequestSource.RequestSourceInternal = sv.InRestrictedSQL builder.RequestSource.RequestSourceType = sv.RequestSourceType + builder.RequestSource.ExplicitRequestSoureType = sv.ExplicitRequestSoureType builder.StoreBatchSize = sv.StoreBatchSize builder.Request.ResourceGroupName = sv.ResourceGroupName builder.Request.StoreBusyThreshold = sv.LoadBasedReplicaReadThreshold diff --git a/go.mod b/go.mod index e5fc3eeb74f2f..f6db7c5484b25 100644 --- a/go.mod +++ b/go.mod @@ -306,3 +306,5 @@ replace ( github.com/pingcap/tidb/parser => ./parser go.opencensus.io => go.opencensus.io v0.23.1-0.20220331163232-052120675fac ) + +replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705075110-157d072330bf diff --git a/go.sum b/go.sum index eeac206c2850b..3afd535466d05 100644 --- a/go.sum +++ b/go.sum @@ -742,6 +742,8 @@ github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705075110-157d072330bf h1:N1wvE/FIEU1Ak3kBPIoOBFsMeUf0raxAekqOnYHqrCQ= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705075110-157d072330bf/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -977,8 +979,6 @@ 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= -github.com/tikv/client-go/v2 v2.0.8-0.20230621031026-864a5fc0c482 h1:KIqPtZ+U4RLuqL6wjobTnNn+111esFtu7+bY/50KKP4= -github.com/tikv/client-go/v2 v2.0.8-0.20230621031026-864a5fc0c482/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/tikv/pd/client v0.0.0-20230613052906-7158cb319935 h1:a5SATBxu/0Z6qNnz4KXDN91gDA06waaYcHM6dkb6lz4= github.com/tikv/pd/client v0.0.0-20230613052906-7158cb319935/go.mod h1:YmNkj9UT8IjwFov9k3oquH0UgIUHniUaQT3jXKgZYbM= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= diff --git a/kv/option.go b/kv/option.go index 4ff9d5c9fbb9d..45d6db4840b0b 100644 --- a/kv/option.go +++ b/kv/option.go @@ -92,6 +92,8 @@ const ( RequestSourceInternal // RequestSourceType set request source type of the current statement. RequestSourceType + // ExplicitRequestSoureType is a complement of RequestSourceType, it may specified by the client or users. + ExplicitRequestSoureType // ReplicaReadAdjuster set the adjust function of cop requsts. ReplicaReadAdjuster // ScanBatchSize set the iter scan batch size. @@ -188,7 +190,7 @@ const ( // Do not classify different tools by now. InternalTxnTools = "tools" // InternalTxnBR is the type of BR usage. - InternalTxnBR = InternalTxnTools + InternalTxnBR = "br" // InternalTxnTrace handles the trace statement. InternalTxnTrace = "Trace" // InternalTxnTTL is the type of TTL usage diff --git a/session/session.go b/session/session.go index 659dc9feeb34c..69f0f3915e8dc 100644 --- a/session/session.go +++ b/session/session.go @@ -644,6 +644,7 @@ func (s *session) doCommit(ctx context.Context) error { s.txn.SetOption(kv.EnableAsyncCommit, sessVars.EnableAsyncCommit) s.txn.SetOption(kv.Enable1PC, sessVars.Enable1PC) s.txn.SetOption(kv.ResourceGroupTagger, sessVars.StmtCtx.GetResourceGroupTagger()) + s.txn.SetOption(kv.ExplicitRequestSoureType, sessVars.ExplicitRequestSoureType) if sessVars.StmtCtx.KvExecCounter != nil { // Bind an interceptor for client-go to count the number of SQL executions of each TiKV. s.txn.SetOption(kv.RPCInterceptor, sessVars.StmtCtx.KvExecCounter.RPCInterceptor()) diff --git a/session/sessiontest/session_test.go b/session/sessiontest/session_test.go index ce687b102e7c6..0ec053b31284e 100644 --- a/session/sessiontest/session_test.go +++ b/session/sessiontest/session_test.go @@ -26,6 +26,8 @@ import ( "time" "github.com/pingcap/failpoint" + "github.com/pingcap/kvproto/pkg/coprocessor" + "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/errno" @@ -53,6 +55,8 @@ import ( "github.com/pingcap/tidb/util/sqlexec" "github.com/stretchr/testify/require" "github.com/tikv/client-go/v2/tikv" + "github.com/tikv/client-go/v2/tikvrpc" + "github.com/tikv/client-go/v2/tikvrpc/interceptor" "github.com/tikv/client-go/v2/txnkv/transaction" ) @@ -3602,3 +3606,35 @@ func TestSQLModeOp(t *testing.T) { a = mysql.SetSQLMode(s, mysql.ModeAllowInvalidDates) require.Equal(t, mysql.ModeNoBackslashEscapes|mysql.ModeOnlyFullGroupBy|mysql.ModeAllowInvalidDates, a) } + +func TestRequestSource(t *testing.T) { + store := testkit.CreateMockStore(t, mockstore.WithStoreType(mockstore.MockTiKV)) + tk := testkit.NewTestKit(t, store) + withCheckInterceptor := func(source string) interceptor.RPCInterceptor { + return interceptor.NewRPCInterceptor("kv-request-source-verify", func(next interceptor.RPCInterceptorFunc) interceptor.RPCInterceptorFunc { + return func(target string, req *tikvrpc.Request) (*tikvrpc.Response, error) { + requestSource := "" + switch r := req.Req.(type) { + case *kvrpcpb.PrewriteRequest: + requestSource = r.GetContext().GetRequestSource() + case *kvrpcpb.CommitRequest: + requestSource = r.GetContext().GetRequestSource() + case *coprocessor.Request: + requestSource = r.GetContext().GetRequestSource() + } + require.Equal(t, source, requestSource) + return next(target, req) + } + }) + } + ctx := context.Background() + + tk.MustExecWithContext(ctx, "use test") + tk.MustExecWithContext(ctx, "create table t(a int primary key, b int)") + tk.MustExecWithContext(ctx, "set @@tidb_request_source_type = 'lightning'") + tk.MustQueryWithContext(ctx, "select @@tidb_request_source_type").Check(testkit.Rows("lightning")) + insertCtx := interceptor.WithRPCInterceptor(context.Background(), withCheckInterceptor("external_Insert_lightning")) + tk.MustExecWithContext(insertCtx, "insert into t values(1, 1)") + selectCtx := interceptor.WithRPCInterceptor(context.Background(), withCheckInterceptor("external_Select_lightning")) + tk.MustExecWithContext(selectCtx, "select count(*) from t;") +} diff --git a/sessionctx/sessionstates/session_states_test.go b/sessionctx/sessionstates/session_states_test.go index f450b07cb8531..f65688de41372 100644 --- a/sessionctx/sessionstates/session_states_test.go +++ b/sessionctx/sessionstates/session_states_test.go @@ -495,6 +495,18 @@ func TestSessionCtx(t *testing.T) { `└─TableFullScan_4 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo`)) }, }, + { + // check reqest source + setFunc: func(tk *testkit.TestKit) any { + tk.MustExec(`set @@tidb_reqest_source="BR"`) + require.Equal(t, "BR", tk.Session().GetSessionVars().RequestSourceType) + return nil + }, + checkFunc: func(tk *testkit.TestKit, param any) { + tk.MustExec(`select count(*) from test.t1`) + tk.MustQuery(`select @@tidb_reqest_source`).Check(testkit.Rows("BR")) + }, + }, } for _, tt := range tests { diff --git a/sessionctx/variable/session.go b/sessionctx/variable/session.go index df4bc8a667a3b..5a3874d12a3df 100644 --- a/sessionctx/variable/session.go +++ b/sessionctx/variable/session.go @@ -1323,6 +1323,8 @@ type SessionVars struct { // RequestSourceType is the type of inner request. RequestSourceType string + // ExplicitRequestSoureType is the type of origin external request. + ExplicitRequestSoureType string // MemoryDebugModeMinHeapInUse indicated the minimum heapInUse threshold that triggers the memoryDebugMode. MemoryDebugModeMinHeapInUse int64 diff --git a/sessionctx/variable/sysvar.go b/sessionctx/variable/sysvar.go index cbea4a761fd37..37f93f8cae353 100644 --- a/sessionctx/variable/sysvar.go +++ b/sessionctx/variable/sysvar.go @@ -384,6 +384,12 @@ var defaultSysVars = []*SysVar{ {Scope: ScopeSession, Name: TiDBUseAlloc, Value: BoolToOnOff(DefTiDBUseAlloc), Type: TypeBool, ReadOnly: true, GetSession: func(s *SessionVars) (string, error) { return BoolToOnOff(s.preUseChunkAlloc), nil }}, + {Scope: ScopeSession, Name: TiDBExplicitRequestSourceType, Value: "", Type: TypeEnum, PossibleValues: []string{"", "lightning", "br", "dumping", "tispark", "background"}, GetSession: func(s *SessionVars) (string, error) { + return s.ExplicitRequestSoureType, nil + }, SetSession: func(s *SessionVars, val string) error { + s.ExplicitRequestSoureType = val + return nil + }}, /* The system variables below have INSTANCE scope */ {Scope: ScopeInstance, Name: TiDBLogFileMaxDays, Value: strconv.Itoa(config.GetGlobalConfig().Log.File.MaxDays), Type: TypeInt, MinValue: 0, MaxValue: math.MaxInt32, SetGlobal: func(_ context.Context, s *SessionVars, val string) error { maxAge, err := strconv.ParseInt(val, 10, 32) diff --git a/sessionctx/variable/tidb_vars.go b/sessionctx/variable/tidb_vars.go index 3c4b2c4a10cec..8d243bbbc4edb 100644 --- a/sessionctx/variable/tidb_vars.go +++ b/sessionctx/variable/tidb_vars.go @@ -274,6 +274,9 @@ const ( // TiDBUseAlloc indicates whether the last statement used chunk alloc TiDBUseAlloc = "last_sql_use_alloc" + + // TiDBExplicitRequestSourceType indicates the source of the request, which can be ["lightning", "br", "dumping", "tispark", "background"]. + TiDBExplicitRequestSourceType = "tidb_request_source_type" ) // TiDB system variable names that both in session and global scope. diff --git a/store/copr/coprocessor.go b/store/copr/coprocessor.go index 23a5ce741b6ae..b2ce336de6eb8 100644 --- a/store/copr/coprocessor.go +++ b/store/copr/coprocessor.go @@ -54,6 +54,7 @@ import ( "github.com/tikv/client-go/v2/metrics" "github.com/tikv/client-go/v2/tikv" "github.com/tikv/client-go/v2/tikvrpc" + "github.com/tikv/client-go/v2/tikvrpc/interceptor" "github.com/tikv/client-go/v2/txnkv/txnlock" "github.com/tikv/client-go/v2/txnkv/txnsnapshot" "github.com/tikv/client-go/v2/util" @@ -88,6 +89,7 @@ func (c *CopClient) Send(ctx context.Context, req *kv.Request, variables interfa } ctx = context.WithValue(ctx, tikv.TxnStartKey(), req.StartTs) ctx = context.WithValue(ctx, util.RequestSourceKey, req.RequestSource) + ctx = interceptor.WithRPCInterceptor(ctx, interceptor.GetRPCInterceptorFromCtx(ctx)) enabledRateLimitAction := option.EnabledRateLimitAction sessionMemTracker := option.SessionMemTracker it, errRes := c.BuildCopIterator(ctx, req, vars, option) diff --git a/store/driver/txn/txn_driver.go b/store/driver/txn/txn_driver.go index 6ec985ec4c6ff..c8424e1ba7fed 100644 --- a/store/driver/txn/txn_driver.go +++ b/store/driver/txn/txn_driver.go @@ -270,6 +270,8 @@ func (txn *tikvTxn) SetOption(opt int, val interface{}) { txn.KVTxn.SetRequestSourceInternal(val.(bool)) case kv.RequestSourceType: txn.KVTxn.SetRequestSourceType(val.(string)) + case kv.ExplicitRequestSoureType: + txn.KVTxn.SetExplicitRequestSourceType(val.(string)) case kv.ReplicaReadAdjuster: txn.KVTxn.GetSnapshot().SetReplicaReadAdjuster(val.(txnkv.ReplicaReadAdjuster)) case kv.TxnSource: From 0ca104ac46698492de060e42e8ace3e21d042fac Mon Sep 17 00:00:00 2001 From: nolouch Date: Wed, 5 Jul 2023 17:05:58 +0800 Subject: [PATCH 2/8] address Signed-off-by: nolouch --- DEPS.bzl | 5 +++-- distsql/request_builder.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- kv/option.go | 4 ++-- session/session.go | 2 +- session/sessiontest/BUILD.bazel | 4 ++++ sessionctx/sessionstates/session_states_test.go | 6 +++--- sessionctx/variable/session.go | 4 ++-- sessionctx/variable/sysvar.go | 7 ++++--- sessionctx/variable/tidb_vars.go | 3 ++- store/copr/BUILD.bazel | 1 + store/driver/txn/txn_driver.go | 2 +- 13 files changed, 27 insertions(+), 19 deletions(-) diff --git a/DEPS.bzl b/DEPS.bzl index 8b5bde200bc95..77d7c98589487 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -3871,8 +3871,9 @@ 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:KIqPtZ+U4RLuqL6wjobTnNn+111esFtu7+bY/50KKP4=", - version = "v2.0.8-0.20230621031026-864a5fc0c482", + replace = "github.com/nolouch/client-go/v2", + sum = "h1:T7YjnmguXAvSLXmV7+sIeMllYdDBLGOyGK13AyFVjRs=", + version = "v2.0.0-alpha.0.20230705081011-2596ac95a7c0", ) go_repository( diff --git a/distsql/request_builder.go b/distsql/request_builder.go index b4d0723d9801a..4911347475446 100644 --- a/distsql/request_builder.go +++ b/distsql/request_builder.go @@ -306,7 +306,7 @@ func (builder *RequestBuilder) SetFromSessionVars(sv *variable.SessionVars) *Req } builder.RequestSource.RequestSourceInternal = sv.InRestrictedSQL builder.RequestSource.RequestSourceType = sv.RequestSourceType - builder.RequestSource.ExplicitRequestSoureType = sv.ExplicitRequestSoureType + builder.RequestSource.ExplicitRequestSourceType = sv.ExplicitRequestSourceType builder.StoreBatchSize = sv.StoreBatchSize builder.Request.ResourceGroupName = sv.ResourceGroupName builder.Request.StoreBusyThreshold = sv.LoadBasedReplicaReadThreshold diff --git a/go.mod b/go.mod index f6db7c5484b25..6208bab586702 100644 --- a/go.mod +++ b/go.mod @@ -307,4 +307,4 @@ replace ( go.opencensus.io => go.opencensus.io v0.23.1-0.20220331163232-052120675fac ) -replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705075110-157d072330bf +replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705081011-2596ac95a7c0 diff --git a/go.sum b/go.sum index 3afd535466d05..4cd32dc13c30b 100644 --- a/go.sum +++ b/go.sum @@ -742,8 +742,8 @@ github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705075110-157d072330bf h1:N1wvE/FIEU1Ak3kBPIoOBFsMeUf0raxAekqOnYHqrCQ= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705075110-157d072330bf/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705081011-2596ac95a7c0 h1:T7YjnmguXAvSLXmV7+sIeMllYdDBLGOyGK13AyFVjRs= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705081011-2596ac95a7c0/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= diff --git a/kv/option.go b/kv/option.go index 45d6db4840b0b..977e07b3899be 100644 --- a/kv/option.go +++ b/kv/option.go @@ -92,8 +92,8 @@ const ( RequestSourceInternal // RequestSourceType set request source type of the current statement. RequestSourceType - // ExplicitRequestSoureType is a complement of RequestSourceType, it may specified by the client or users. - ExplicitRequestSoureType + // ExplicitRequestSourceType is a complement of RequestSourceType, it may specified by the client or users. + ExplicitRequestSourceType // ReplicaReadAdjuster set the adjust function of cop requsts. ReplicaReadAdjuster // ScanBatchSize set the iter scan batch size. diff --git a/session/session.go b/session/session.go index 69f0f3915e8dc..e51883ed559de 100644 --- a/session/session.go +++ b/session/session.go @@ -644,7 +644,7 @@ func (s *session) doCommit(ctx context.Context) error { s.txn.SetOption(kv.EnableAsyncCommit, sessVars.EnableAsyncCommit) s.txn.SetOption(kv.Enable1PC, sessVars.Enable1PC) s.txn.SetOption(kv.ResourceGroupTagger, sessVars.StmtCtx.GetResourceGroupTagger()) - s.txn.SetOption(kv.ExplicitRequestSoureType, sessVars.ExplicitRequestSoureType) + s.txn.SetOption(kv.ExplicitRequestSourceType, sessVars.ExplicitRequestSourceType) if sessVars.StmtCtx.KvExecCounter != nil { // Bind an interceptor for client-go to count the number of SQL executions of each TiKV. s.txn.SetOption(kv.RPCInterceptor, sessVars.StmtCtx.KvExecCounter.RPCInterceptor()) diff --git a/session/sessiontest/BUILD.bazel b/session/sessiontest/BUILD.bazel index c8348dd42c6e2..56c2f55f38ed7 100644 --- a/session/sessiontest/BUILD.bazel +++ b/session/sessiontest/BUILD.bazel @@ -39,8 +39,12 @@ go_test( "//util/memory", "//util/sqlexec", "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/coprocessor", + "@com_github_pingcap_kvproto//pkg/kvrpcpb", "@com_github_stretchr_testify//require", "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_client_go_v2//tikvrpc", + "@com_github_tikv_client_go_v2//tikvrpc/interceptor", "@com_github_tikv_client_go_v2//txnkv/transaction", "@org_uber_go_goleak//:goleak", ], diff --git a/sessionctx/sessionstates/session_states_test.go b/sessionctx/sessionstates/session_states_test.go index f65688de41372..98eb3a3e0132c 100644 --- a/sessionctx/sessionstates/session_states_test.go +++ b/sessionctx/sessionstates/session_states_test.go @@ -498,13 +498,13 @@ func TestSessionCtx(t *testing.T) { { // check reqest source setFunc: func(tk *testkit.TestKit) any { - tk.MustExec(`set @@tidb_reqest_source="BR"`) - require.Equal(t, "BR", tk.Session().GetSessionVars().RequestSourceType) + tk.MustExec(`set @@tidb_request_source_type="lightning"`) + require.Equal(t, "lightning", tk.Session().GetSessionVars().ExplicitRequestSourceType) return nil }, checkFunc: func(tk *testkit.TestKit, param any) { tk.MustExec(`select count(*) from test.t1`) - tk.MustQuery(`select @@tidb_reqest_source`).Check(testkit.Rows("BR")) + tk.MustQuery(`select @@tidb_request_source_type`).Check(testkit.Rows("lightning")) }, }, } diff --git a/sessionctx/variable/session.go b/sessionctx/variable/session.go index 5a3874d12a3df..5a9a04d403502 100644 --- a/sessionctx/variable/session.go +++ b/sessionctx/variable/session.go @@ -1323,8 +1323,8 @@ type SessionVars struct { // RequestSourceType is the type of inner request. RequestSourceType string - // ExplicitRequestSoureType is the type of origin external request. - ExplicitRequestSoureType string + // ExplicitRequestSourceType is the type of origin external request. + ExplicitRequestSourceType string // MemoryDebugModeMinHeapInUse indicated the minimum heapInUse threshold that triggers the memoryDebugMode. MemoryDebugModeMinHeapInUse int64 diff --git a/sessionctx/variable/sysvar.go b/sessionctx/variable/sysvar.go index 37f93f8cae353..f07bd268eadbc 100644 --- a/sessionctx/variable/sysvar.go +++ b/sessionctx/variable/sysvar.go @@ -51,6 +51,7 @@ import ( "github.com/pingcap/tidb/util/versioninfo" tikvcfg "github.com/tikv/client-go/v2/config" tikvstore "github.com/tikv/client-go/v2/kv" + tikvcliutil "github.com/tikv/client-go/v2/util" atomic2 "go.uber.org/atomic" "go.uber.org/zap" ) @@ -384,10 +385,10 @@ var defaultSysVars = []*SysVar{ {Scope: ScopeSession, Name: TiDBUseAlloc, Value: BoolToOnOff(DefTiDBUseAlloc), Type: TypeBool, ReadOnly: true, GetSession: func(s *SessionVars) (string, error) { return BoolToOnOff(s.preUseChunkAlloc), nil }}, - {Scope: ScopeSession, Name: TiDBExplicitRequestSourceType, Value: "", Type: TypeEnum, PossibleValues: []string{"", "lightning", "br", "dumping", "tispark", "background"}, GetSession: func(s *SessionVars) (string, error) { - return s.ExplicitRequestSoureType, nil + {Scope: ScopeSession, Name: TiDBExplicitRequestSourceType, Value: "", Type: TypeEnum, PossibleValues: tikvcliutil.ExplictTypeList, GetSession: func(s *SessionVars) (string, error) { + return s.ExplicitRequestSourceType, nil }, SetSession: func(s *SessionVars, val string) error { - s.ExplicitRequestSoureType = val + s.ExplicitRequestSourceType = val return nil }}, /* The system variables below have INSTANCE scope */ diff --git a/sessionctx/variable/tidb_vars.go b/sessionctx/variable/tidb_vars.go index 8d243bbbc4edb..844198dac1688 100644 --- a/sessionctx/variable/tidb_vars.go +++ b/sessionctx/variable/tidb_vars.go @@ -275,7 +275,8 @@ const ( // TiDBUseAlloc indicates whether the last statement used chunk alloc TiDBUseAlloc = "last_sql_use_alloc" - // TiDBExplicitRequestSourceType indicates the source of the request, which can be ["lightning", "br", "dumping", "tispark", "background"]. + // TiDBExplicitRequestSourceType indicates the source of the request, it's a complement of RequestSourceType. + // The value maybe "lightning", "br", "dumpling" etc. TiDBExplicitRequestSourceType = "tidb_request_source_type" ) diff --git a/store/copr/BUILD.bazel b/store/copr/BUILD.bazel index 56c271066a478..1f36698ef252a 100644 --- a/store/copr/BUILD.bazel +++ b/store/copr/BUILD.bazel @@ -53,6 +53,7 @@ go_library( "@com_github_tikv_client_go_v2//metrics", "@com_github_tikv_client_go_v2//tikv", "@com_github_tikv_client_go_v2//tikvrpc", + "@com_github_tikv_client_go_v2//tikvrpc/interceptor", "@com_github_tikv_client_go_v2//txnkv/txnlock", "@com_github_tikv_client_go_v2//txnkv/txnsnapshot", "@com_github_tikv_client_go_v2//util", diff --git a/store/driver/txn/txn_driver.go b/store/driver/txn/txn_driver.go index c8424e1ba7fed..d96da324135bb 100644 --- a/store/driver/txn/txn_driver.go +++ b/store/driver/txn/txn_driver.go @@ -270,7 +270,7 @@ func (txn *tikvTxn) SetOption(opt int, val interface{}) { txn.KVTxn.SetRequestSourceInternal(val.(bool)) case kv.RequestSourceType: txn.KVTxn.SetRequestSourceType(val.(string)) - case kv.ExplicitRequestSoureType: + case kv.ExplicitRequestSourceType: txn.KVTxn.SetExplicitRequestSourceType(val.(string)) case kv.ReplicaReadAdjuster: txn.KVTxn.GetSnapshot().SetReplicaReadAdjuster(val.(txnkv.ReplicaReadAdjuster)) From b6614c97f0791b101b994372892dda8cf0db4bbf Mon Sep 17 00:00:00 2001 From: nolouch Date: Wed, 5 Jul 2023 18:13:08 +0800 Subject: [PATCH 3/8] update Signed-off-by: nolouch --- DEPS.bzl | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- sessionctx/variable/sysvar.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DEPS.bzl b/DEPS.bzl index 40f8efa3ebd9e..31507321cbb88 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -3872,8 +3872,8 @@ def go_deps(): build_file_proto_mode = "disable_global", importpath = "github.com/tikv/client-go/v2", replace = "github.com/nolouch/client-go/v2", - sum = "h1:T7YjnmguXAvSLXmV7+sIeMllYdDBLGOyGK13AyFVjRs=", - version = "v2.0.0-alpha.0.20230705081011-2596ac95a7c0", + sum = "h1:w/mBUmzzBY9VTs1/neggfXFD5AVWG2q5BsoCBZC87wk=", + version = "v2.0.0-alpha.0.20230705095409-b2b79e4bb084", ) go_repository( diff --git a/go.mod b/go.mod index 13f83598277f8..18e3bb6f94a77 100644 --- a/go.mod +++ b/go.mod @@ -307,4 +307,4 @@ replace ( go.opencensus.io => go.opencensus.io v0.23.1-0.20220331163232-052120675fac ) -replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705081011-2596ac95a7c0 +replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705095409-b2b79e4bb084 diff --git a/go.sum b/go.sum index a987220180ca7..4aa2254267895 100644 --- a/go.sum +++ b/go.sum @@ -742,8 +742,8 @@ github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705081011-2596ac95a7c0 h1:T7YjnmguXAvSLXmV7+sIeMllYdDBLGOyGK13AyFVjRs= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705081011-2596ac95a7c0/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705095409-b2b79e4bb084 h1:w/mBUmzzBY9VTs1/neggfXFD5AVWG2q5BsoCBZC87wk= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705095409-b2b79e4bb084/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= diff --git a/sessionctx/variable/sysvar.go b/sessionctx/variable/sysvar.go index 30ba89553601b..4b40520cc4393 100644 --- a/sessionctx/variable/sysvar.go +++ b/sessionctx/variable/sysvar.go @@ -386,7 +386,7 @@ var defaultSysVars = []*SysVar{ {Scope: ScopeSession, Name: TiDBUseAlloc, Value: BoolToOnOff(DefTiDBUseAlloc), Type: TypeBool, ReadOnly: true, GetSession: func(s *SessionVars) (string, error) { return BoolToOnOff(s.preUseChunkAlloc), nil }}, - {Scope: ScopeSession, Name: TiDBExplicitRequestSourceType, Value: "", Type: TypeEnum, PossibleValues: tikvcliutil.ExplictTypeList, GetSession: func(s *SessionVars) (string, error) { + {Scope: ScopeSession, Name: TiDBExplicitRequestSourceType, Value: "", Type: TypeEnum, PossibleValues: tikvcliutil.ExplicitTypeList, GetSession: func(s *SessionVars) (string, error) { return s.ExplicitRequestSourceType, nil }, SetSession: func(s *SessionVars, val string) error { s.ExplicitRequestSourceType = val From 2b41ea9833f20902eddfa3c1e43eb7e03c74717d Mon Sep 17 00:00:00 2001 From: nolouch Date: Thu, 6 Jul 2023 11:38:08 +0800 Subject: [PATCH 4/8] add analyze&checksum Signed-off-by: nolouch --- distsql/request_builder.go | 6 ++++++ executor/analyze_col.go | 1 + executor/analyze_idx.go | 1 + executor/checksum.go | 2 ++ 4 files changed, 10 insertions(+) diff --git a/distsql/request_builder.go b/distsql/request_builder.go index 4911347475446..2f27dd177004c 100644 --- a/distsql/request_builder.go +++ b/distsql/request_builder.go @@ -359,6 +359,12 @@ func (builder *RequestBuilder) SetResourceGroupName(name string) *RequestBuilder return builder } +// SetExplicitRequestSourceType sets the request source type. +func (builder *RequestBuilder) SetExplicitRequestSourceType(sourceType string) *RequestBuilder { + builder.RequestSource.RequestSourceType = sourceType + return builder +} + func (builder *RequestBuilder) verifyTxnScope() error { txnScope := builder.TxnScope if txnScope == "" || txnScope == kv.GlobalReplicaScope || builder.is == nil { diff --git a/executor/analyze_col.go b/executor/analyze_col.go index e5bade4d3dca4..4b9a784f014ab 100644 --- a/executor/analyze_col.go +++ b/executor/analyze_col.go @@ -125,6 +125,7 @@ func (e *AnalyzeColumnsExec) buildResp(ranges []*ranger.Range) (distsql.SelectRe SetConcurrency(e.concurrency). SetMemTracker(e.memTracker). SetResourceGroupName(e.ctx.GetSessionVars().ResourceGroupName). + SetExplicitRequestSourceType(e.ctx.GetSessionVars().ExplicitRequestSourceType). Build() if err != nil { return nil, err diff --git a/executor/analyze_idx.go b/executor/analyze_idx.go index a6acd640479e8..bf30d4fd9749d 100644 --- a/executor/analyze_idx.go +++ b/executor/analyze_idx.go @@ -156,6 +156,7 @@ func (e *AnalyzeIndexExec) fetchAnalyzeResult(ranges []*ranger.Range, isNullRang SetKeepOrder(true). SetConcurrency(e.concurrency). SetResourceGroupName(e.ctx.GetSessionVars().ResourceGroupName). + SetExplicitRequestSourceType(e.ctx.GetSessionVars().ExplicitRequestSourceType). Build() if err != nil { return err diff --git a/executor/checksum.go b/executor/checksum.go index bb6a64bf9cbee..decc77943c8fa 100644 --- a/executor/checksum.go +++ b/executor/checksum.go @@ -248,6 +248,7 @@ func (c *checksumContext) buildTableRequest(ctx sessionctx.Context, tableID int6 SetStartTS(c.StartTs). SetConcurrency(ctx.GetSessionVars().DistSQLScanConcurrency()). SetResourceGroupName(ctx.GetSessionVars().ResourceGroupName). + SetExplicitRequestSourceType(ctx.GetSessionVars().ExplicitRequestSourceType). Build() } @@ -266,6 +267,7 @@ func (c *checksumContext) buildIndexRequest(ctx sessionctx.Context, tableID int6 SetStartTS(c.StartTs). SetConcurrency(ctx.GetSessionVars().DistSQLScanConcurrency()). SetResourceGroupName(ctx.GetSessionVars().ResourceGroupName). + SetExplicitRequestSourceType(ctx.GetSessionVars().ExplicitRequestSourceType). Build() } From bbf51da38425f713eecd0a01b7aaa439d00afe99 Mon Sep 17 00:00:00 2001 From: nolouch Date: Thu, 6 Jul 2023 12:50:25 +0800 Subject: [PATCH 5/8] update client-go Signed-off-by: nolouch --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 18e3bb6f94a77..5ff24466c1816 100644 --- a/go.mod +++ b/go.mod @@ -307,4 +307,4 @@ replace ( go.opencensus.io => go.opencensus.io v0.23.1-0.20220331163232-052120675fac ) -replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705095409-b2b79e4bb084 +replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230706044458-6992649dba54 diff --git a/go.sum b/go.sum index 4aa2254267895..efd85db063f21 100644 --- a/go.sum +++ b/go.sum @@ -742,8 +742,8 @@ github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705095409-b2b79e4bb084 h1:w/mBUmzzBY9VTs1/neggfXFD5AVWG2q5BsoCBZC87wk= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230705095409-b2b79e4bb084/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230706044458-6992649dba54 h1:6CD6dYHog0PIXq8/wrLASWm78DXjcoc6+OMQtBXOqYE= +github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230706044458-6992649dba54/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= From 1d4f9f7a24049fdcdc43979746ce48fd050344ad Mon Sep 17 00:00:00 2001 From: nolouch Date: Thu, 6 Jul 2023 12:57:03 +0800 Subject: [PATCH 6/8] address Signed-off-by: nolouch --- distsql/request_builder.go | 4 ++-- session/sessiontest/session_test.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/distsql/request_builder.go b/distsql/request_builder.go index 2f27dd177004c..bf0ae0d582e77 100644 --- a/distsql/request_builder.go +++ b/distsql/request_builder.go @@ -359,9 +359,9 @@ func (builder *RequestBuilder) SetResourceGroupName(name string) *RequestBuilder return builder } -// SetExplicitRequestSourceType sets the request source type. +// SetExplicitRequestSourceType sets the explicit request source type. func (builder *RequestBuilder) SetExplicitRequestSourceType(sourceType string) *RequestBuilder { - builder.RequestSource.RequestSourceType = sourceType + builder.RequestSource.ExplicitRequestSourceType = sourceType return builder } diff --git a/session/sessiontest/session_test.go b/session/sessiontest/session_test.go index 0ec053b31284e..54d9b4fcaa3b9 100644 --- a/session/sessiontest/session_test.go +++ b/session/sessiontest/session_test.go @@ -3628,7 +3628,6 @@ func TestRequestSource(t *testing.T) { }) } ctx := context.Background() - tk.MustExecWithContext(ctx, "use test") tk.MustExecWithContext(ctx, "create table t(a int primary key, b int)") tk.MustExecWithContext(ctx, "set @@tidb_request_source_type = 'lightning'") From 9487a6a58980321fe5798996966a33eaaf6055d9 Mon Sep 17 00:00:00 2001 From: nolouch Date: Thu, 6 Jul 2023 14:04:58 +0800 Subject: [PATCH 7/8] fix bazel, address comments Signed-off-by: nolouch --- DEPS.bzl | 4 ++-- sessionctx/sessionstates/session_states_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS.bzl b/DEPS.bzl index 31507321cbb88..699eacbb8d640 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -3872,8 +3872,8 @@ def go_deps(): build_file_proto_mode = "disable_global", importpath = "github.com/tikv/client-go/v2", replace = "github.com/nolouch/client-go/v2", - sum = "h1:w/mBUmzzBY9VTs1/neggfXFD5AVWG2q5BsoCBZC87wk=", - version = "v2.0.0-alpha.0.20230705095409-b2b79e4bb084", + sum = "h1:6CD6dYHog0PIXq8/wrLASWm78DXjcoc6+OMQtBXOqYE=", + version = "v2.0.0-alpha.0.20230706044458-6992649dba54", ) go_repository( diff --git a/sessionctx/sessionstates/session_states_test.go b/sessionctx/sessionstates/session_states_test.go index 53f3dd2886250..7b24a563e0dd3 100644 --- a/sessionctx/sessionstates/session_states_test.go +++ b/sessionctx/sessionstates/session_states_test.go @@ -496,7 +496,7 @@ func TestSessionCtx(t *testing.T) { }, }, { - // check reqest source + // check request source setFunc: func(tk *testkit.TestKit) any { tk.MustExec(`set @@tidb_request_source_type="lightning"`) require.Equal(t, "lightning", tk.Session().GetSessionVars().ExplicitRequestSourceType) From 58e1f3cee3ceb983a005e27b45028bd5eac8f596 Mon Sep 17 00:00:00 2001 From: nolouch Date: Fri, 7 Jul 2023 15:41:38 +0800 Subject: [PATCH 8/8] update kvproto Signed-off-by: nolouch --- DEPS.bzl | 5 ++--- go.mod | 4 +--- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/DEPS.bzl b/DEPS.bzl index 699eacbb8d640..7c87ad389de6d 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -3871,9 +3871,8 @@ def go_deps(): name = "com_github_tikv_client_go_v2", build_file_proto_mode = "disable_global", importpath = "github.com/tikv/client-go/v2", - replace = "github.com/nolouch/client-go/v2", - sum = "h1:6CD6dYHog0PIXq8/wrLASWm78DXjcoc6+OMQtBXOqYE=", - version = "v2.0.0-alpha.0.20230706044458-6992649dba54", + sum = "h1:pLUQsFZGE3z7OlZddP+WHkb85rLoxPwRd8CknfSw804=", + version = "v2.0.8-0.20230707070242-178f6fa01aab", ) go_repository( diff --git a/go.mod b/go.mod index 5ff24466c1816..b30a02722e096 100644 --- a/go.mod +++ b/go.mod @@ -97,7 +97,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tdakkota/asciicheck v0.2.0 github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 - github.com/tikv/client-go/v2 v2.0.8-0.20230704071705-c0cf773917d9 + github.com/tikv/client-go/v2 v2.0.8-0.20230707070242-178f6fa01aab github.com/tikv/pd/client v0.0.0-20230613052906-7158cb319935 github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 github.com/twmb/murmur3 v1.1.6 @@ -306,5 +306,3 @@ replace ( github.com/pingcap/tidb/parser => ./parser go.opencensus.io => go.opencensus.io v0.23.1-0.20220331163232-052120675fac ) - -replace github.com/tikv/client-go/v2 => github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230706044458-6992649dba54 diff --git a/go.sum b/go.sum index efd85db063f21..1a5378843120e 100644 --- a/go.sum +++ b/go.sum @@ -742,8 +742,6 @@ github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230706044458-6992649dba54 h1:6CD6dYHog0PIXq8/wrLASWm78DXjcoc6+OMQtBXOqYE= -github.com/nolouch/client-go/v2 v2.0.0-alpha.0.20230706044458-6992649dba54/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -979,6 +977,8 @@ 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= +github.com/tikv/client-go/v2 v2.0.8-0.20230707070242-178f6fa01aab h1:pLUQsFZGE3z7OlZddP+WHkb85rLoxPwRd8CknfSw804= +github.com/tikv/client-go/v2 v2.0.8-0.20230707070242-178f6fa01aab/go.mod h1:4KkKqjJgKlvvWMyNqdnAlYFfV4QjEj1fEb5Hb/FoT88= github.com/tikv/pd/client v0.0.0-20230613052906-7158cb319935 h1:a5SATBxu/0Z6qNnz4KXDN91gDA06waaYcHM6dkb6lz4= github.com/tikv/pd/client v0.0.0-20230613052906-7158cb319935/go.mod h1:YmNkj9UT8IjwFov9k3oquH0UgIUHniUaQT3jXKgZYbM= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M=