Skip to content

Commit fb769a3

Browse files
authored
executor: expose read pool task details in diagnostics (#69971) (#70067)
close #69970
1 parent 2c22c61 commit fb769a3

16 files changed

Lines changed: 284 additions & 29 deletions

File tree

DEPS.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,8 +3519,8 @@ def go_deps():
35193519
name = "com_github_pingcap_kvproto",
35203520
build_file_proto_mode = "disable_global",
35213521
importpath = "github.com/pingcap/kvproto",
3522-
sum = "h1:PJIfTrhcVitRq5nJmzTDCV75YpaDJc+YKMtqgyBfH84=",
3523-
version = "v0.0.0-20260716111302-363178052f57",
3522+
sum = "h1:ZfyjOcFgQQ4HPPJUcaNRTBOAvpKLvsOyDtuPagZ9JQM=",
3523+
version = "v0.0.0-20260724075646-dc53c468806a",
35243524
)
35253525
go_repository(
35263526
name = "com_github_pingcap_log",
@@ -4206,8 +4206,8 @@ def go_deps():
42064206
build_tags = ["nextgen", "intest"],
42074207
build_file_proto_mode = "disable_global",
42084208
importpath = "github.com/tikv/client-go/v2",
4209-
sum = "h1:RSzuwb/YdgiMPQO7dRZ8ilE71YL4n03nGU9qrCXDZEg=",
4210-
version = "v2.0.8-0.20260716132210-520a5635e5e3",
4209+
sum = "h1:aIX8PIhLflFQ9g9rvT6aJpMZlIc7NM5HTDxlGG4rVgM=",
4210+
version = "v2.0.8-0.20260724083407-9d3413c420ce",
42114211
)
42124212
go_repository(
42134213
name = "com_github_tikv_pd_client",

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ require (
100100
github.com/pingcap/errors v0.11.5-0.20260508054701-306e305bcf41
101101
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
102102
github.com/pingcap/fn v1.0.0
103-
github.com/pingcap/kvproto v0.0.0-20260716111302-363178052f57
103+
github.com/pingcap/kvproto v0.0.0-20260724075646-dc53c468806a
104104
github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9
105105
github.com/pingcap/metering_sdk v0.0.0-20260324055927-14fead745f1d
106106
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
@@ -123,7 +123,7 @@ require (
123123
github.com/stathat/consistent v1.0.0
124124
github.com/stretchr/testify v1.11.1
125125
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
126-
github.com/tikv/client-go/v2 v2.0.8-0.20260716132210-520a5635e5e3
126+
github.com/tikv/client-go/v2 v2.0.8-0.20260724083407-9d3413c420ce
127127
github.com/tikv/pd/client v0.0.0-20260716095117-1636e69a936b
128128
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67
129129
github.com/twmb/murmur3 v1.1.6

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@ github.com/pingcap/fn v1.0.0/go.mod h1:u9WZ1ZiOD1RpNhcI42RucFh/lBuzTu6rw88a+oF2Z
726726
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=
727727
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
728728
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
729-
github.com/pingcap/kvproto v0.0.0-20260716111302-363178052f57 h1:PJIfTrhcVitRq5nJmzTDCV75YpaDJc+YKMtqgyBfH84=
730-
github.com/pingcap/kvproto v0.0.0-20260716111302-363178052f57/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
729+
github.com/pingcap/kvproto v0.0.0-20260724075646-dc53c468806a h1:ZfyjOcFgQQ4HPPJUcaNRTBOAvpKLvsOyDtuPagZ9JQM=
730+
github.com/pingcap/kvproto v0.0.0-20260724075646-dc53c468806a/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
731731
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM=
732732
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
733733
github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9 h1:qG9BSvlWFEE5otQGamuWedx9LRm0nrHvsQRQiW8SxEs=
@@ -893,8 +893,8 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
893893
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
894894
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
895895
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
896-
github.com/tikv/client-go/v2 v2.0.8-0.20260716132210-520a5635e5e3 h1:RSzuwb/YdgiMPQO7dRZ8ilE71YL4n03nGU9qrCXDZEg=
897-
github.com/tikv/client-go/v2 v2.0.8-0.20260716132210-520a5635e5e3/go.mod h1:0IJooYYDE5i4jKOug+hnphJrmrFORf3VgwfpDWsQoTQ=
896+
github.com/tikv/client-go/v2 v2.0.8-0.20260724083407-9d3413c420ce h1:aIX8PIhLflFQ9g9rvT6aJpMZlIc7NM5HTDxlGG4rVgM=
897+
github.com/tikv/client-go/v2 v2.0.8-0.20260724083407-9d3413c420ce/go.mod h1:lwCOaEEjaFKkUd7SdSkaTmZsMl7kRXKrnjEjLEY62T8=
898898
github.com/tikv/pd/client v0.0.0-20260716095117-1636e69a936b h1:Bk296Skcn1GfRARDmYAuGONfnybon7ZntmCTrlCnzpQ=
899899
github.com/tikv/pd/client v0.0.0-20260716095117-1636e69a936b/go.mod h1:5xk417Ar8t3SNWBhEwAJ/uycGmTs8ZUQN3GgdUJRFhE=
900900
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk=

pkg/distsql/select_result.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ func (r *selectResult) fetchRespWithIntermediateResults(ctx context.Context, int
463463
return err
464464
}
465465
r.ctx.ExecDetails.MergeCopExecDetails(&copStats.CopExecDetails, duration)
466+
r.ctx.ExecDetails.MergeReadPoolTaskDetails(copStats.ReadPoolTaskDetails)
466467
}
467468
}
468469
if len(r.selectResp.Chunks) != 0 {
@@ -673,7 +674,14 @@ func (r *selectResult) updateCopRuntimeStats(ctx context.Context, copStats *copr
673674
}
674675
if hasExecutor {
675676
if len(r.copPlanIDs) > 0 {
676-
r.ctx.RuntimeStatsColl.RecordCopStats(r.copPlanIDs[len(r.copPlanIDs)-1], r.storeType, copStats.ScanDetail, copStats.TimeDetail, nil)
677+
r.ctx.RuntimeStatsColl.RecordCopStats(
678+
r.copPlanIDs[len(r.copPlanIDs)-1],
679+
r.storeType,
680+
copStats.ScanDetail,
681+
copStats.TimeDetail,
682+
copStats.ReadPoolTaskDetails,
683+
nil,
684+
)
677685
}
678686
recordExecutionSummariesForTiFlashTasks(r.ctx.RuntimeStatsColl, r.selectResp.GetExecutionSummaries(), r.storeType, r.copPlanIDs)
679687
// report MPP cross AZ network traffic bytes to resource control manager.
@@ -707,7 +715,14 @@ func (r *selectResult) updateCopRuntimeStats(ctx context.Context, copStats *copr
707715
}
708716
planID := r.copPlanIDs[i]
709717
if i == len(r.copPlanIDs)-1 {
710-
r.ctx.RuntimeStatsColl.RecordCopStats(planID, r.storeType, copStats.ScanDetail, copStats.TimeDetail, summary)
718+
r.ctx.RuntimeStatsColl.RecordCopStats(
719+
planID,
720+
r.storeType,
721+
copStats.ScanDetail,
722+
copStats.TimeDetail,
723+
copStats.ReadPoolTaskDetails,
724+
summary,
725+
)
711726
} else if summary != nil {
712727
r.ctx.RuntimeStatsColl.RecordOneCopTask(planID, r.storeType, summary)
713728
}
@@ -757,6 +772,7 @@ func (r *selectResult) close() error {
757772
for _, copStats := range unconsumedCopStats {
758773
_ = r.updateCopRuntimeStats(context.Background(), copStats, time.Duration(0), true)
759774
r.ctx.ExecDetails.MergeCopExecDetails(&copStats.CopExecDetails, 0)
775+
r.ctx.ExecDetails.MergeReadPoolTaskDetails(copStats.ReadPoolTaskDetails)
760776
}
761777
}
762778
}

pkg/executor/batch_point_get.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ func (e *BatchPointGetExec) Close() error {
183183
if e.RuntimeStats() != nil {
184184
defer func() {
185185
sc := e.Ctx().GetSessionVars().StmtCtx
186+
sc.MergeReadPoolTaskDetails(e.stats.SnapshotRuntimeStats.GetReadPoolTaskDetails())
186187
sc.RuntimeStatsColl.RegisterStats(e.ID(), e.stats)
187188
timeDetail := e.stats.SnapshotRuntimeStats.GetTimeDetail()
188189
if timeDetail != nil {

pkg/executor/point_get.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ func (e *PointGetExecutor) Close() error {
273273
if e.stats != nil {
274274
defer func() {
275275
sc := e.Ctx().GetSessionVars().StmtCtx
276+
sc.MergeReadPoolTaskDetails(e.stats.SnapshotRuntimeStats.GetReadPoolTaskDetails())
276277
sc.RuntimeStatsColl.RegisterStats(e.ID(), e.stats)
277278
timeDetail := e.stats.SnapshotRuntimeStats.GetTimeDetail()
278279
if timeDetail != nil {

pkg/executor/slow_query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ func getColumnValueFactoryByName(colName string, columnIdx int) (slowQueryColumn
11491149
case variable.SlowLogUserStr, variable.SlowLogHostStr, execdetails.BackoffTypesStr, variable.SlowLogDBStr, variable.SlowLogIndexNamesStr, variable.SlowLogDigestStr,
11501150
variable.SlowLogStatsInfoStr, variable.SlowLogCopProcAddr, variable.SlowLogCopWaitAddr, variable.SlowLogPlanDigest,
11511151
variable.SlowLogPrevStmt, variable.SlowLogQuerySQLStr, variable.SlowLogWarnings, variable.SlowLogSessAliasStr,
1152-
variable.SlowLogResourceGroup, variable.SlowLogRequestUnitV2Detail:
1152+
variable.SlowLogResourceGroup, variable.SlowLogRequestUnitV2Detail, execdetails.ReadPoolTaskDetailsStr:
11531153
return func(row []types.Datum, value string, _ *time.Location, _ *slowLogChecker) (valid bool, err error) {
11541154
row[columnIdx] = types.NewStringDatum(value)
11551155
return true, nil

pkg/executor/slow_query_sql_test.go

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,27 @@ import (
1919
"fmt"
2020
"math"
2121
"os"
22+
"strings"
2223
"testing"
2324
"time"
2425

26+
"github.com/pingcap/failpoint"
27+
"github.com/pingcap/kvproto/pkg/coprocessor"
28+
"github.com/pingcap/kvproto/pkg/kvrpcpb"
2529
"github.com/pingcap/tidb/pkg/config"
2630
"github.com/pingcap/tidb/pkg/executor"
2731
"github.com/pingcap/tidb/pkg/meta/model"
2832
"github.com/pingcap/tidb/pkg/parser/ast"
2933
"github.com/pingcap/tidb/pkg/parser/auth"
3034
"github.com/pingcap/tidb/pkg/store/mockstore"
35+
"github.com/pingcap/tidb/pkg/store/mockstore/unistore"
3136
"github.com/pingcap/tidb/pkg/testkit"
3237
"github.com/pingcap/tidb/pkg/testkit/external"
3338
"github.com/pingcap/tidb/pkg/testkit/testdata"
3439
"github.com/pingcap/tidb/pkg/testkit/testutil"
3540
"github.com/pingcap/tidb/pkg/util/logutil"
3641
"github.com/stretchr/testify/require"
42+
"github.com/tikv/client-go/v2/tikvrpc"
3743
)
3844

3945
func TestSlowQueryWithoutSlowLog(t *testing.T) {
@@ -553,6 +559,143 @@ func TestStorageEnginesInSlowQuery(t *testing.T) {
553559
Check(testkit.Rows("1 0"))
554560
}
555561

562+
func TestReadPoolTaskDetailsInDiagnostics(t *testing.T) {
563+
originCfg := config.GetGlobalConfig()
564+
newCfg := *originCfg
565+
f, err := os.CreateTemp("", "tidb-slow-*.log")
566+
require.NoError(t, err)
567+
newCfg.Log.SlowQueryFile = f.Name()
568+
config.StoreGlobalConfig(&newCfg)
569+
t.Cleanup(func() {
570+
if t.Failed() {
571+
if data, err := os.ReadFile(f.Name()); err == nil {
572+
t.Logf("slow log contents (%d bytes):\n%s", len(data), data)
573+
}
574+
}
575+
config.StoreGlobalConfig(originCfg)
576+
require.NoError(t, f.Close())
577+
require.NoError(t, os.Remove(f.Name()))
578+
})
579+
require.NoError(t, logutil.InitLogger(newCfg.Log.ToLogConfig()))
580+
581+
store := testkit.CreateMockStore(t)
582+
tk := testkit.NewTestKit(t, store)
583+
tk.MustExec("use test")
584+
tk.MustExec(fmt.Sprintf("set @@tidb_slow_query_file='%v'", f.Name()))
585+
tk.MustExec("set tidb_slow_log_threshold=0")
586+
tk.MustExec("set tidb_enable_paging=0")
587+
t.Cleanup(func() {
588+
tk.MustExec("set tidb_slow_log_threshold=300")
589+
})
590+
591+
tk.MustExec("create table t_read_pool_details (id int primary key, v int)")
592+
tk.MustExec("insert into t_read_pool_details values (1, 10), (2, 20), (3, 30)")
593+
594+
responseHook := func(_ *tikvrpc.Request, resp *tikvrpc.Response) {
595+
newExecDetails := func() *kvrpcpb.ExecDetailsV2 {
596+
return &kvrpcpb.ExecDetailsV2{
597+
ReadPoolTaskDetails: &kvrpcpb.PoolTaskDetails{
598+
PollCount: 4,
599+
DispatchCount: 2,
600+
TotalWallNanos: uint64((20 * time.Millisecond).Nanoseconds()),
601+
TotalQueueWaitNanos: uint64((6 * time.Millisecond).Nanoseconds()),
602+
MaxQueueWaitNanos: uint64((4 * time.Millisecond).Nanoseconds()),
603+
MinQueueWaitNanos: uint64((2 * time.Millisecond).Nanoseconds()),
604+
TotalWakeWaitNanos: uint64((4 * time.Millisecond).Nanoseconds()),
605+
MaxWakeWaitNanos: uint64((4 * time.Millisecond).Nanoseconds()),
606+
MinWakeWaitNanos: uint64((4 * time.Millisecond).Nanoseconds()),
607+
FairQueueEnabled: true,
608+
TotalFairQueueWaitedTaskSlices: 6,
609+
MaxFairQueueWaitedTaskSlices: 4,
610+
MinFairQueueWaitedTaskSlices: 2,
611+
PollCpuNanos: uint64((8 * time.Millisecond).Nanoseconds()),
612+
MaxPollCpuNanos: uint64((3 * time.Millisecond).Nanoseconds()),
613+
MinPollCpuNanos: uint64((1 * time.Millisecond).Nanoseconds()),
614+
PollWallNanos: uint64((12 * time.Millisecond).Nanoseconds()),
615+
MaxPollWallNanos: uint64((5 * time.Millisecond).Nanoseconds()),
616+
MinPollWallNanos: uint64((2 * time.Millisecond).Nanoseconds()),
617+
},
618+
}
619+
}
620+
621+
switch typedResp := resp.Resp.(type) {
622+
case *kvrpcpb.GetResponse:
623+
typedResp.ExecDetailsV2 = newExecDetails()
624+
case *kvrpcpb.BatchGetResponse:
625+
typedResp.ExecDetailsV2 = newExecDetails()
626+
case *coprocessor.Response:
627+
typedResp.ExecDetailsV2 = newExecDetails()
628+
}
629+
}
630+
unistore.UnistoreRPCClientResponseHook.Store(&responseHook)
631+
require.NoError(t, failpoint.Enable(
632+
"github.com/pingcap/tidb/pkg/store/mockstore/unistore/unistoreRPCClientResponseHook",
633+
"return(true)",
634+
))
635+
t.Cleanup(func() {
636+
unistore.UnistoreRPCClientResponseHook.Store(nil)
637+
require.NoError(t, failpoint.Disable(
638+
"github.com/pingcap/tidb/pkg/store/mockstore/unistore/unistoreRPCClientResponseHook",
639+
))
640+
})
641+
642+
const expectedDetails = "{tasks:1, poll_count:{total:4, avg:4, max:4, min:4}, " +
643+
"dispatch_count:{total:2, max:2, min:2}, " +
644+
"task_wall_time:{total:20ms, avg:20ms, max:20ms, min:20ms}, " +
645+
"queue_wait:{total:6ms, avg:3ms, max:4ms, min:2ms}, " +
646+
"wake_wait:{total:4ms, avg:4ms, max:4ms, min:4ms}, " +
647+
"fair_queue:{enabled:true, waited_task_slices:{total:6, avg:3, max:4, min:2}}, " +
648+
"poll_cpu:{total:8ms, avg:2ms, max:3ms, min:1ms}, " +
649+
"poll_wall:{total:12ms, avg:3ms, max:5ms, min:2ms}}"
650+
cases := []struct {
651+
name string
652+
plan string
653+
sql string
654+
}{
655+
{
656+
name: "point get",
657+
plan: "Point_Get",
658+
sql: "select /* read_pool_point_get */ * from t_read_pool_details where id = 1",
659+
},
660+
{
661+
name: "batch point get",
662+
plan: "Batch_Point_Get",
663+
sql: "select /* read_pool_batch_point_get */ * from t_read_pool_details where id in (1, 2)",
664+
},
665+
{
666+
name: "cop task",
667+
plan: "TableReader",
668+
sql: "select /* read_pool_cop */ * from t_read_pool_details where v >= 10",
669+
},
670+
}
671+
672+
for _, testCase := range cases {
673+
t.Run(testCase.name, func(t *testing.T) {
674+
tk.MustHavePlan(testCase.sql, testCase.plan)
675+
tk.MustQuery(testCase.sql)
676+
tk.EventuallyMustQueryAndCheck(
677+
"select read_pool_task_details from information_schema.slow_query "+
678+
"where query = '"+testCase.sql+";' "+
679+
"order by time desc limit 1",
680+
nil,
681+
testkit.Rows(expectedDetails),
682+
2*time.Second,
683+
50*time.Millisecond,
684+
)
685+
686+
rows := tk.MustQuery("explain analyze " + testCase.sql).Rows()
687+
foundDetails := false
688+
for _, row := range rows {
689+
if strings.Contains(fmt.Sprint(row[5]), "read_pool:"+expectedDetails) {
690+
foundDetails = true
691+
break
692+
}
693+
}
694+
require.True(t, foundDetails, "read-pool task details not found in EXPLAIN ANALYZE output: %v", rows)
695+
})
696+
}
697+
}
698+
556699
func TestSessionConnectAttrsInSlowQuery(t *testing.T) {
557700
originCfg := config.GetGlobalConfig()
558701
newCfg := *originCfg

pkg/executor/slow_query_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ select * from t;`
190190
}
191191
expectRecordString := `2019-04-28 15:24:04.309074,` +
192192
`405888132465033227,root,localhost,0,alias123,57,0.12,0.216905,` +
193-
`0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,0,0,0.38,0.021,0,0,0,1,637,0,10,10,10,10,100,,,1,42a1c8aae6f133e934d4bf0147491709a8812ea05ff8819ec522780fe657b772,t1:1,t2:2,` +
193+
`0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,0,0,0.38,0.021,0,0,0,1,637,0,10,10,10,10,100,,,,1,42a1c8aae6f133e934d4bf0147491709a8812ea05ff8819ec522780fe657b772,t1:1,t2:2,` +
194194
`0.1,0.2,0.03,127.0.0.1:20160,0.05,0.6,0.8,0.0.0.0:20160,70724,23333,65536,0,0,0,30000,3000,10000,1000,500000,500005,300000,300005,0,0,,` +
195195
`Cop_backoff_regionMiss_total_times: 200 Cop_backoff_regionMiss_total_time: 0.2 Cop_backoff_regionMiss_max_time: 0.2 Cop_backoff_regionMiss_max_addr: 127.0.0.1 Cop_backoff_regionMiss_avg_time: 0.2 Cop_backoff_regionMiss_p90_time: 0.2 Cop_backoff_rpcPD_total_times: 200 Cop_backoff_rpcPD_total_time: 0.2 Cop_backoff_rpcPD_max_time: 0.2 Cop_backoff_rpcPD_max_addr: 127.0.0.1 Cop_backoff_rpcPD_avg_time: 0.2 Cop_backoff_rpcPD_p90_time: 0.2 Cop_backoff_rpcTiKV_total_times: 200 Cop_backoff_rpcTiKV_total_time: 0.2 Cop_backoff_rpcTiKV_max_time: 0.2 Cop_backoff_rpcTiKV_max_addr: 127.0.0.1 Cop_backoff_rpcTiKV_avg_time: 0.2 Cop_backoff_rpcTiKV_p90_time: 0.2,` +
196196
`0,0,1,0,1,1,0,default,2.158,2.123,0.05,0.01,0.021,1,1,150,total_ru:150.00, tidb_ru:0.00, tikv_ru:100.00, tiflash_ru:50.00,,60e9378c746d9a2be1c791047e008967cf252eb6de9167ad3aa6098fa2d523f4,` +
@@ -213,7 +213,7 @@ select * from t;`
213213
}
214214
expectRecordString = `2019-04-28 15:24:04.309074,` +
215215
`405888132465033227,root,localhost,0,alias123,57,0.12,0.216905,` +
216-
`0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,0,0,0.38,0.021,0,0,0,1,637,0,10,10,10,10,100,,,1,42a1c8aae6f133e934d4bf0147491709a8812ea05ff8819ec522780fe657b772,t1:1,t2:2,` +
216+
`0,0,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,0,0,0.38,0.021,0,0,0,1,637,0,10,10,10,10,100,,,,1,42a1c8aae6f133e934d4bf0147491709a8812ea05ff8819ec522780fe657b772,t1:1,t2:2,` +
217217
`0.1,0.2,0.03,127.0.0.1:20160,0.05,0.6,0.8,0.0.0.0:20160,70724,23333,65536,0,0,0,30000,3000,10000,1000,500000,500005,300000,300005,0,0,,` +
218218
`Cop_backoff_regionMiss_total_times: 200 Cop_backoff_regionMiss_total_time: 0.2 Cop_backoff_regionMiss_max_time: 0.2 Cop_backoff_regionMiss_max_addr: 127.0.0.1 Cop_backoff_regionMiss_avg_time: 0.2 Cop_backoff_regionMiss_p90_time: 0.2 Cop_backoff_rpcPD_total_times: 200 Cop_backoff_rpcPD_total_time: 0.2 Cop_backoff_rpcPD_max_time: 0.2 Cop_backoff_rpcPD_max_addr: 127.0.0.1 Cop_backoff_rpcPD_avg_time: 0.2 Cop_backoff_rpcPD_p90_time: 0.2 Cop_backoff_rpcTiKV_total_times: 200 Cop_backoff_rpcTiKV_total_time: 0.2 Cop_backoff_rpcTiKV_max_time: 0.2 Cop_backoff_rpcTiKV_max_addr: 127.0.0.1 Cop_backoff_rpcTiKV_avg_time: 0.2 Cop_backoff_rpcTiKV_p90_time: 0.2,` +
219219
`0,0,1,0,1,1,0,default,2.158,2.123,0.05,0.01,0.021,1,1,150,total_ru:150.00, tidb_ru:0.00, tikv_ru:100.00, tiflash_ru:50.00,,60e9378c746d9a2be1c791047e008967cf252eb6de9167ad3aa6098fa2d523f4,` +
@@ -281,9 +281,9 @@ select * from t;
281281
rows, err = parseSlowLog(ctx, reader)
282282
require.NoError(t, err)
283283
require.Len(t, rows, 1)
284-
value, _ := rows[0][41].ToString()
284+
value, _ := rows[0][42].ToString()
285285
require.Equal(t, value, "a: b")
286-
value, _ = rows[0][42].ToString()
286+
value, _ = rows[0][43].ToString()
287287
require.Equal(t, value, "[t:i: a]")
288288
}
289289

pkg/infoschema/tables.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ var slowQueryCols = []columnInfo{
934934
{name: execdetails.RocksdbBlockCacheHitCountStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag},
935935
{name: execdetails.RocksdbBlockReadCountStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag},
936936
{name: execdetails.RocksdbBlockReadByteStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag},
937+
{name: execdetails.ReadPoolTaskDetailsStr, tp: mysql.TypeLongBlob, size: types.UnspecifiedLength},
937938
{name: variable.SlowLogDBStr, tp: mysql.TypeVarchar, size: 64},
938939
{name: variable.SlowLogIndexNamesStr, tp: mysql.TypeVarchar, size: 100},
939940
{name: variable.SlowLogIsInternalStr, tp: mysql.TypeTiny, size: 1},

0 commit comments

Comments
 (0)