From 1d5138ab5465cc43eb5e6255003121aa2129aedc Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Mon, 5 Aug 2024 17:53:23 +0800 Subject: [PATCH 1/5] store/copr: revert pr/35975, do it correctly this time --- pkg/store/copr/coprocessor.go | 11 -- .../integrationtest/r/executor/issues.result | 134 ++++++++++++++++++ tests/integrationtest/t/executor/issues.test | 103 ++++++++++++++ 3 files changed, 237 insertions(+), 11 deletions(-) diff --git a/pkg/store/copr/coprocessor.go b/pkg/store/copr/coprocessor.go index 91b67115953fa..6b59d8096784d 100644 --- a/pkg/store/copr/coprocessor.go +++ b/pkg/store/copr/coprocessor.go @@ -220,17 +220,6 @@ func (c *CopClient) BuildCopIterator(ctx context.Context, req *kv.Request, vars } if it.req.KeepOrder { - oldConcurrency := it.concurrency - partitionNum := req.KeyRanges.PartitionNum() - if partitionNum > 0 && partitionNum < it.concurrency { - it.concurrency = partitionNum - } - failpoint.Inject("testRateLimitActionMockConsumeAndAssert", func(val failpoint.Value) { - if val.(bool) { - // When the concurrency is too small, test case tests/realtikvtest/sessiontest.TestCoprocessorOOMAction can't trigger OOM condition - it.concurrency = oldConcurrency - } - }) if it.smallTaskConcurrency > 20 { it.smallTaskConcurrency = 20 } diff --git a/tests/integrationtest/r/executor/issues.result b/tests/integrationtest/r/executor/issues.result index 8b8e310f27ac2..11321c0070c98 100644 --- a/tests/integrationtest/r/executor/issues.result +++ b/tests/integrationtest/r/executor/issues.result @@ -868,3 +868,137 @@ set @@tidb_max_chunk_size = default; select tan(9021874879467600608071521900001091070693729763119983979); tan(9021874879467600608071521900001091070693729763119983979) 8.068627196084492 +drop table if exists t; +create table t (id int auto_increment, c char(120), primary key(id)); +create table pt (id int primary key auto_increment, val int) partition by range (id) +(PARTITION p1 VALUES LESS THAN (100), +PARTITION p2 VALUES LESS THAN (200), +PARTITION p3 VALUES LESS THAN (300), +PARTITION p4 VALUES LESS THAN (400), +PARTITION p5 VALUES LESS THAN (500), +PARTITION p6 VALUES LESS THAN (600), +PARTITION p7 VALUES LESS THAN (700)); +insert into t (c) values ('abc'), ('def'), ('ghi'), ('jkl'); +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +split table t between (0) and (40960) regions 30; +TOTAL_SPLIT_REGION SCATTER_FINISH_RATIO +29 1 +analyze table t; +insert into pt (val) values (123),(456),(789),(1112); +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +split table pt between (0) and (40960) regions 30; +TOTAL_SPLIT_REGION SCATTER_FINISH_RATIO +203 1 +analyze table pt; +set @@tidb_distsql_scan_concurrency = default; +explain analyze select * from t order by id; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +TableReader_11 256.00 256 root NULL max_distsql_concurrency: 15 NULL +└─TableFullScan_10 256.00 256 cop[tikv] table:t NULL keep order:true +explain analyze select * from t limit 100; # expected distsql concurrency 1 +id estRows actRows task access object execution info operator info memory disk +Limit_7 100.00 100 root NULL NULL offset:0, count:100 +└─TableReader_11 100.00 100 root NULL max_distsql_concurrency: 1 NULL + └─Limit_10 100.00 100 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_9 100.00 160 cop[tikv] table:t NULL keep order:false +explain analyze select * from t limit 100000; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_7 256.00 256 root NULL NULL offset:0, count:100000 +└─TableReader_11 256.00 256 root NULL max_distsql_concurrency: 15 NULL + └─Limit_10 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_9 256.00 256 cop[tikv] table:t NULL keep order:false +explain analyze select * from t where c = 'abc' limit 100; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_8 0.26 64 root NULL NULL offset:0, count:100 +└─TableReader_13 0.26 64 root NULL max_distsql_concurrency: 15 NULL + └─Limit_12 0.26 64 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_11 0.26 64 cop[tikv] NULL NULL eq(executor__issues.t.c, "abc") + └─TableFullScan_10 256.00 64 cop[tikv] table:t NULL keep order:false, stats:partial[c:unInitialized] +explain analyze select * from t where c = 'abc' limit 100000; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_8 0.26 64 root NULL NULL offset:0, count:100000 +└─TableReader_13 0.26 64 root NULL max_distsql_concurrency: 15 NULL + └─Limit_12 0.26 64 cop[tikv] NULL NULL offset:0, count:100000 + └─Selection_11 0.26 64 cop[tikv] NULL NULL eq(executor__issues.t.c, "abc") + └─TableFullScan_10 256.00 64 cop[tikv] table:t NULL keep order:false, stats:partial[c:unInitialized] +explain analyze select * from t order by id limit 100; # expected distsql concurrency 1 +id estRows actRows task access object execution info operator info memory disk +Limit_10 100.00 100 root NULL NULL offset:0, count:100 +└─TableReader_17 100.00 100 root NULL max_distsql_concurrency: 1 NULL + └─Limit_16 100.00 100 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_15 100.00 160 cop[tikv] table:t NULL keep order:true +explain analyze select * from t order by id limit 100000; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_11 256.00 256 root NULL NULL offset:0, count:100000 +└─TableReader_21 256.00 256 root NULL max_distsql_concurrency: 15 NULL + └─Limit_20 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_19 256.00 256 cop[tikv] table:t NULL keep order:true +explain analyze select * from t where c = 'abd' order by id limit 100; +id estRows actRows task access object execution info operator info memory disk +Limit_11 0.26 0 root NULL NULL offset:0, count:100 +└─TableReader_20 0.26 0 root NULL max_distsql_concurrency: 15 NULL + └─Limit_19 0.26 0 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_18 0.26 0 cop[tikv] NULL NULL eq(executor__issues.t.c, "abd") + └─TableFullScan_17 256.00 0 cop[tikv] table:t NULL keep order:true, stats:partial[c:unInitialized] +select @@tidb_partition_prune_mode; +@@tidb_partition_prune_mode +dynamic +explain analyze select * from pt order by id; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +TableReader_11 256.00 256 root partition:all max_distsql_concurrency: 15 NULL +└─TableFullScan_10 256.00 256 cop[tikv] table:pt NULL keep order:true +explain analyze select * from pt limit 100; # expected distsql concurrency 7 +id estRows actRows task access object execution info operator info memory disk +Limit_7 100.00 100 root NULL NULL offset:0, count:100 +└─TableReader_11 100.00 107 root partition:all max_distsql_concurrency: 7 NULL + └─Limit_10 100.00 199 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_9 100.00 199 cop[tikv] table:pt NULL keep order:false +explain analyze select * from pt limit 100000; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_7 256.00 256 root NULL NULL offset:0, count:100000 +└─TableReader_11 256.00 256 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_10 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_9 256.00 256 cop[tikv] table:pt NULL keep order:false +explain analyze select * from pt where val = 125 limit 100; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_8 100.00 0 root NULL NULL offset:0, count:100 +└─TableReader_13 100.00 0 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_12 100.00 0 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_11 100.00 0 cop[tikv] NULL NULL eq(executor__issues.pt.val, 125) + └─TableFullScan_10 125.00 0 cop[tikv] table:pt NULL keep order:false, stats:partial[val:missing] +explain analyze select * from pt where val = 125 limit 100000; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_8 204.80 0 root NULL NULL offset:0, count:100000 +└─TableReader_13 204.80 0 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_12 204.80 0 cop[tikv] NULL NULL offset:0, count:100000 + └─Selection_11 204.80 0 cop[tikv] NULL NULL eq(executor__issues.pt.val, 125) + └─TableFullScan_10 256.00 0 cop[tikv] table:pt NULL keep order:false, stats:partial[val:missing] +explain analyze select * from pt order by id limit 100; # expected distsql concurrency 7, but currently get 1, see issue #55190 +id estRows actRows task access object execution info operator info memory disk +Limit_10 100.00 100 root NULL NULL offset:0, count:100 +└─TableReader_17 100.00 100 root partition:all max_distsql_concurrency: 1 NULL + └─Limit_16 100.00 256 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_15 100.00 256 cop[tikv] table:pt NULL keep order:true +explain analyze select * from pt order by id limit 100000; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_11 256.00 256 root NULL NULL offset:0, count:100000 +└─TableReader_21 256.00 256 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_20 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_19 256.00 256 cop[tikv] table:pt NULL keep order:true +explain analyze select * from pt where val = 126 order by id limit 100; # expected distsql concurrency 15 +id estRows actRows task access object execution info operator info memory disk +Limit_11 100.00 0 root NULL NULL offset:0, count:100 +└─TableReader_20 100.00 0 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_19 100.00 0 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_18 100.00 0 cop[tikv] NULL NULL eq(executor__issues.pt.val, 126) + └─TableFullScan_17 125.00 0 cop[tikv] table:pt NULL keep order:true, stats:partial[val:missing] diff --git a/tests/integrationtest/t/executor/issues.test b/tests/integrationtest/t/executor/issues.test index 99cf608589270..3785e72895f36 100644 --- a/tests/integrationtest/t/executor/issues.test +++ b/tests/integrationtest/t/executor/issues.test @@ -663,3 +663,106 @@ set @@tidb_max_chunk_size = default; # TestIssue52672 select tan(9021874879467600608071521900001091070693729763119983979); + + +# TestIssue54969 +# For order by query, the distsql concurrency should be @@tidb_distsql_scan_concurrency. +# For simple limit N query and N < 10000, the distsql concurrency should be 1 (normal table) +# For this case nn partition table, concurrency should be partition number. +drop table if exists t; +create table t (id int auto_increment, c char(120), primary key(id)); +create table pt (id int primary key auto_increment, val int) partition by range (id) +(PARTITION p1 VALUES LESS THAN (100), + PARTITION p2 VALUES LESS THAN (200), + PARTITION p3 VALUES LESS THAN (300), + PARTITION p4 VALUES LESS THAN (400), + PARTITION p5 VALUES LESS THAN (500), + PARTITION p6 VALUES LESS THAN (600), + PARTITION p7 VALUES LESS THAN (700)); +insert into t (c) values ('abc'), ('def'), ('ghi'), ('jkl'); +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +insert into t (c) select (c) from t; +split table t between (0) and (40960) regions 30; +analyze table t; + +insert into pt (val) values (123),(456),(789),(1112); +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +insert into pt (val) select (val) from pt; +split table pt between (0) and (40960) regions 30; +analyze table pt; + +set @@tidb_distsql_scan_concurrency = default; +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t order by id; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t limit 100; # expected distsql concurrency 1 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t limit 100000; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t where c = 'abc' limit 100; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t where c = 'abc' limit 100000; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t order by id limit 100; # expected distsql concurrency 1 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t order by id limit 100000; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from t where c = 'abd' order by id limit 100; +select @@tidb_partition_prune_mode; + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt order by id; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt limit 100; # expected distsql concurrency 7 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt limit 100000; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt where val = 125 limit 100; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt where val = 125 limit 100000; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt order by id limit 100; # expected distsql concurrency 7, but currently get 1, see issue #55190 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt order by id limit 100000; # expected distsql concurrency 15 + +-- replace_column 8 9 +-- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// +explain analyze select * from pt where val = 126 order by id limit 100; # expected distsql concurrency 15 + + From b8ad4a68152f2bb5eb40ebdca16956eb3b90e7e9 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Mon, 5 Aug 2024 20:09:47 +0800 Subject: [PATCH 2/5] partly revert --- pkg/distsql/request_builder.go | 50 +++++++++++++------ .../integrationtest/r/executor/issues.result | 8 +-- tests/integrationtest/t/executor/issues.test | 4 +- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/pkg/distsql/request_builder.go b/pkg/distsql/request_builder.go index f5058361c860c..a681897f0d605 100644 --- a/pkg/distsql/request_builder.go +++ b/pkg/distsql/request_builder.go @@ -47,6 +47,9 @@ type RequestBuilder struct { kv.Request is infoschema.MetaOnlyInfoSchema err error + + // When SetDAGRequest is called, builder will also this field. + dag *tipb.DAGRequest } // Build builds a "kv.Request". @@ -75,6 +78,38 @@ func (builder *RequestBuilder) Build() (*kv.Request, error) { if builder.Request.KeyRanges == nil { builder.Request.KeyRanges = kv.NewNonPartitionedKeyRanges(nil) } + + if dag := builder.dag; dag != nil { + if execCnt := len(dag.Executors); execCnt != 0 { + // select * from t limit 10 + if dag.Executors[execCnt-1].GetLimit() != nil { + limit := dag.Executors[execCnt-1].GetLimit() + builder.Request.LimitSize = limit.GetLimit() + // When the DAG is just simple scan and small limit, set concurrency to 1 would be sufficient. + if execCnt == 2 { + if limit.Limit < estimatedRegionRowCount { + if kr := builder.Request.KeyRanges; kr != nil { + builder.Request.Concurrency = kr.PartitionNum() + } else { + builder.Request.Concurrency = 1 + } + } + } + } + + // select * from t order by id + if builder.Request.KeepOrder && execCnt == 1 { + // When the DAG is just simple scan and keep order, set concurrency to 2. + // If a lot data are returned to client, mysql protocol is the bottleneck so concurrency 2 is enough. + // If very few data are returned to client, the speed is not optimal but good enough. + switch dag.Executors[0].Tp { + case tipb.ExecType_TypeTableScan, tipb.ExecType_TypeIndexScan, tipb.ExecType_TypePartitionTableScan: + builder.Request.Concurrency = 2 + } + } + } + } + return &builder.Request, builder.err } @@ -154,20 +189,7 @@ func (builder *RequestBuilder) SetDAGRequest(dag *tipb.DAGRequest) *RequestBuild builder.Request.Tp = kv.ReqTypeDAG builder.Request.Cacheable = true builder.Request.Data, builder.err = dag.Marshal() - } - if execCnt := len(dag.Executors); execCnt != 0 && dag.Executors[execCnt-1].GetLimit() != nil { - limit := dag.Executors[execCnt-1].GetLimit() - builder.Request.LimitSize = limit.GetLimit() - // When the DAG is just simple scan and small limit, set concurrency to 1 would be sufficient. - if execCnt == 2 { - if limit.Limit < estimatedRegionRowCount { - if kr := builder.Request.KeyRanges; kr != nil { - builder.Request.Concurrency = kr.PartitionNum() - } else { - builder.Request.Concurrency = 1 - } - } - } + builder.dag = dag } return builder } diff --git a/tests/integrationtest/r/executor/issues.result b/tests/integrationtest/r/executor/issues.result index 11321c0070c98..1d24415fd4d64 100644 --- a/tests/integrationtest/r/executor/issues.result +++ b/tests/integrationtest/r/executor/issues.result @@ -901,9 +901,9 @@ TOTAL_SPLIT_REGION SCATTER_FINISH_RATIO 203 1 analyze table pt; set @@tidb_distsql_scan_concurrency = default; -explain analyze select * from t order by id; # expected distsql concurrency 15 +explain analyze select * from t order by id; # expected distsql concurrency 2 id estRows actRows task access object execution info operator info memory disk -TableReader_11 256.00 256 root NULL max_distsql_concurrency: 15 NULL +TableReader_11 256.00 256 root NULL max_distsql_concurrency: 2 NULL └─TableFullScan_10 256.00 256 cop[tikv] table:t NULL keep order:true explain analyze select * from t limit 100; # expected distsql concurrency 1 id estRows actRows task access object execution info operator info memory disk @@ -953,9 +953,9 @@ Limit_11 0.26 0 root NULL NULL offset:0, count:100 select @@tidb_partition_prune_mode; @@tidb_partition_prune_mode dynamic -explain analyze select * from pt order by id; # expected distsql concurrency 15 +explain analyze select * from pt order by id; # expected distsql concurrency 2 id estRows actRows task access object execution info operator info memory disk -TableReader_11 256.00 256 root partition:all max_distsql_concurrency: 15 NULL +TableReader_11 256.00 256 root partition:all max_distsql_concurrency: 2 NULL └─TableFullScan_10 256.00 256 cop[tikv] table:pt NULL keep order:true explain analyze select * from pt limit 100; # expected distsql concurrency 7 id estRows actRows task access object execution info operator info memory disk diff --git a/tests/integrationtest/t/executor/issues.test b/tests/integrationtest/t/executor/issues.test index 3785e72895f36..cd44db622a7c8 100644 --- a/tests/integrationtest/t/executor/issues.test +++ b/tests/integrationtest/t/executor/issues.test @@ -702,7 +702,7 @@ analyze table pt; set @@tidb_distsql_scan_concurrency = default; -- replace_column 8 9 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// -explain analyze select * from t order by id; # expected distsql concurrency 15 +explain analyze select * from t order by id; # expected distsql concurrency 2 -- replace_column 8 9 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// @@ -735,7 +735,7 @@ select @@tidb_partition_prune_mode; -- replace_column 8 9 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// -explain analyze select * from pt order by id; # expected distsql concurrency 15 +explain analyze select * from pt order by id; # expected distsql concurrency 2 -- replace_column 8 9 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// From 85d4b1db9cca5e271ade26b95fff5c716d960c66 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Tue, 6 Aug 2024 01:16:30 +0800 Subject: [PATCH 3/5] fix CI --- pkg/distsql/request_builder.go | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/pkg/distsql/request_builder.go b/pkg/distsql/request_builder.go index a681897f0d605..1782e03562d20 100644 --- a/pkg/distsql/request_builder.go +++ b/pkg/distsql/request_builder.go @@ -80,25 +80,9 @@ func (builder *RequestBuilder) Build() (*kv.Request, error) { } if dag := builder.dag; dag != nil { - if execCnt := len(dag.Executors); execCnt != 0 { - // select * from t limit 10 - if dag.Executors[execCnt-1].GetLimit() != nil { - limit := dag.Executors[execCnt-1].GetLimit() - builder.Request.LimitSize = limit.GetLimit() - // When the DAG is just simple scan and small limit, set concurrency to 1 would be sufficient. - if execCnt == 2 { - if limit.Limit < estimatedRegionRowCount { - if kr := builder.Request.KeyRanges; kr != nil { - builder.Request.Concurrency = kr.PartitionNum() - } else { - builder.Request.Concurrency = 1 - } - } - } - } - + if execCnt := len(dag.Executors); execCnt == 1 { // select * from t order by id - if builder.Request.KeepOrder && execCnt == 1 { + if builder.Request.KeepOrder { // When the DAG is just simple scan and keep order, set concurrency to 2. // If a lot data are returned to client, mysql protocol is the bottleneck so concurrency 2 is enough. // If very few data are returned to client, the speed is not optimal but good enough. @@ -190,6 +174,20 @@ func (builder *RequestBuilder) SetDAGRequest(dag *tipb.DAGRequest) *RequestBuild builder.Request.Cacheable = true builder.Request.Data, builder.err = dag.Marshal() builder.dag = dag + if execCnt := len(dag.Executors); execCnt != 0 && dag.Executors[execCnt-1].GetLimit() != nil { + limit := dag.Executors[execCnt-1].GetLimit() + builder.Request.LimitSize = limit.GetLimit() + // When the DAG is just simple scan and small limit, set concurrency to 1 would be sufficient. + if execCnt == 2 { + if limit.Limit < estimatedRegionRowCount { + if kr := builder.Request.KeyRanges; kr != nil { + builder.Request.Concurrency = kr.PartitionNum() + } else { + builder.Request.Concurrency = 1 + } + } + } + } } return builder } From 3cd26e4f08d25494785db9805fbd2d9e8e554588 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Tue, 6 Aug 2024 11:32:19 +0800 Subject: [PATCH 4/5] fix TestCoprocessorOOMAction --- pkg/distsql/request_builder.go | 7 +++++++ pkg/session/test/variable/variable_test.go | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/pkg/distsql/request_builder.go b/pkg/distsql/request_builder.go index 1782e03562d20..9f0b8b24a2a18 100644 --- a/pkg/distsql/request_builder.go +++ b/pkg/distsql/request_builder.go @@ -81,6 +81,7 @@ func (builder *RequestBuilder) Build() (*kv.Request, error) { if dag := builder.dag; dag != nil { if execCnt := len(dag.Executors); execCnt == 1 { + oldConcurrency := builder.Request.Concurrency // select * from t order by id if builder.Request.KeepOrder { // When the DAG is just simple scan and keep order, set concurrency to 2. @@ -89,6 +90,12 @@ func (builder *RequestBuilder) Build() (*kv.Request, error) { switch dag.Executors[0].Tp { case tipb.ExecType_TypeTableScan, tipb.ExecType_TypeIndexScan, tipb.ExecType_TypePartitionTableScan: builder.Request.Concurrency = 2 + failpoint.Inject("testRateLimitActionMockConsumeAndAssert", func(val failpoint.Value) { + if val.(bool) { + // When the concurrency is too small, test case tests/realtikvtest/sessiontest.TestCoprocessorOOMAction can't trigger OOM condition + builder.Request.Concurrency = oldConcurrency + } + }) } } } diff --git a/pkg/session/test/variable/variable_test.go b/pkg/session/test/variable/variable_test.go index c4078af451fdb..957c880bcb48d 100644 --- a/pkg/session/test/variable/variable_test.go +++ b/pkg/session/test/variable/variable_test.go @@ -93,6 +93,11 @@ func TestCoprocessorOOMAction(t *testing.T) { sql: "select id from t5", }, } + + require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/distsql/testRateLimitActionMockConsumeAndAssert", `return(true)`)) + defer func() { + require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/distsql/testRateLimitActionMockConsumeAndAssert")) + }() require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/store/copr/testRateLimitActionMockConsumeAndAssert", `return(true)`)) defer func() { require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/store/copr/testRateLimitActionMockConsumeAndAssert")) From 4e9dfc445463193249b35b451a761eeb75c43167 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Tue, 6 Aug 2024 12:26:22 +0800 Subject: [PATCH 5/5] make integration test stable --- .../integrationtest/r/executor/issues.result | 132 +++++++++--------- tests/integrationtest/t/executor/issues.test | 32 ++--- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/tests/integrationtest/r/executor/issues.result b/tests/integrationtest/r/executor/issues.result index 1d24415fd4d64..c9d9e476f65dc 100644 --- a/tests/integrationtest/r/executor/issues.result +++ b/tests/integrationtest/r/executor/issues.result @@ -903,102 +903,102 @@ analyze table pt; set @@tidb_distsql_scan_concurrency = default; explain analyze select * from t order by id; # expected distsql concurrency 2 id estRows actRows task access object execution info operator info memory disk -TableReader_11 256.00 256 root NULL max_distsql_concurrency: 2 NULL -└─TableFullScan_10 256.00 256 cop[tikv] table:t NULL keep order:true +TableReader_11 256.00 root NULL max_distsql_concurrency: 2 NULL +└─TableFullScan_10 256.00 cop[tikv] table:t NULL keep order:true explain analyze select * from t limit 100; # expected distsql concurrency 1 id estRows actRows task access object execution info operator info memory disk -Limit_7 100.00 100 root NULL NULL offset:0, count:100 -└─TableReader_11 100.00 100 root NULL max_distsql_concurrency: 1 NULL - └─Limit_10 100.00 100 cop[tikv] NULL NULL offset:0, count:100 - └─TableFullScan_9 100.00 160 cop[tikv] table:t NULL keep order:false +Limit_7 100.00 root NULL NULL offset:0, count:100 +└─TableReader_11 100.00 root NULL max_distsql_concurrency: 1 NULL + └─Limit_10 100.00 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_9 100.00 cop[tikv] table:t NULL keep order:false explain analyze select * from t limit 100000; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_7 256.00 256 root NULL NULL offset:0, count:100000 -└─TableReader_11 256.00 256 root NULL max_distsql_concurrency: 15 NULL - └─Limit_10 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 - └─TableFullScan_9 256.00 256 cop[tikv] table:t NULL keep order:false +Limit_7 256.00 root NULL NULL offset:0, count:100000 +└─TableReader_11 256.00 root NULL max_distsql_concurrency: 15 NULL + └─Limit_10 256.00 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_9 256.00 cop[tikv] table:t NULL keep order:false explain analyze select * from t where c = 'abc' limit 100; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_8 0.26 64 root NULL NULL offset:0, count:100 -└─TableReader_13 0.26 64 root NULL max_distsql_concurrency: 15 NULL - └─Limit_12 0.26 64 cop[tikv] NULL NULL offset:0, count:100 - └─Selection_11 0.26 64 cop[tikv] NULL NULL eq(executor__issues.t.c, "abc") - └─TableFullScan_10 256.00 64 cop[tikv] table:t NULL keep order:false, stats:partial[c:unInitialized] +Limit_8 0.26 root NULL NULL offset:0, count:100 +└─TableReader_13 0.26 root NULL max_distsql_concurrency: 15 NULL + └─Limit_12 0.26 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_11 0.26 cop[tikv] NULL NULL eq(executor__issues.t.c, "abc") + └─TableFullScan_10 256.00 cop[tikv] table:t NULL keep order:false, stats:partial[c:unInitialized] explain analyze select * from t where c = 'abc' limit 100000; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_8 0.26 64 root NULL NULL offset:0, count:100000 -└─TableReader_13 0.26 64 root NULL max_distsql_concurrency: 15 NULL - └─Limit_12 0.26 64 cop[tikv] NULL NULL offset:0, count:100000 - └─Selection_11 0.26 64 cop[tikv] NULL NULL eq(executor__issues.t.c, "abc") - └─TableFullScan_10 256.00 64 cop[tikv] table:t NULL keep order:false, stats:partial[c:unInitialized] +Limit_8 0.26 root NULL NULL offset:0, count:100000 +└─TableReader_13 0.26 root NULL max_distsql_concurrency: 15 NULL + └─Limit_12 0.26 cop[tikv] NULL NULL offset:0, count:100000 + └─Selection_11 0.26 cop[tikv] NULL NULL eq(executor__issues.t.c, "abc") + └─TableFullScan_10 256.00 cop[tikv] table:t NULL keep order:false, stats:partial[c:unInitialized] explain analyze select * from t order by id limit 100; # expected distsql concurrency 1 id estRows actRows task access object execution info operator info memory disk -Limit_10 100.00 100 root NULL NULL offset:0, count:100 -└─TableReader_17 100.00 100 root NULL max_distsql_concurrency: 1 NULL - └─Limit_16 100.00 100 cop[tikv] NULL NULL offset:0, count:100 - └─TableFullScan_15 100.00 160 cop[tikv] table:t NULL keep order:true +Limit_10 100.00 root NULL NULL offset:0, count:100 +└─TableReader_17 100.00 root NULL max_distsql_concurrency: 1 NULL + └─Limit_16 100.00 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_15 100.00 cop[tikv] table:t NULL keep order:true explain analyze select * from t order by id limit 100000; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_11 256.00 256 root NULL NULL offset:0, count:100000 -└─TableReader_21 256.00 256 root NULL max_distsql_concurrency: 15 NULL - └─Limit_20 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 - └─TableFullScan_19 256.00 256 cop[tikv] table:t NULL keep order:true +Limit_11 256.00 root NULL NULL offset:0, count:100000 +└─TableReader_21 256.00 root NULL max_distsql_concurrency: 15 NULL + └─Limit_20 256.00 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_19 256.00 cop[tikv] table:t NULL keep order:true explain analyze select * from t where c = 'abd' order by id limit 100; id estRows actRows task access object execution info operator info memory disk -Limit_11 0.26 0 root NULL NULL offset:0, count:100 -└─TableReader_20 0.26 0 root NULL max_distsql_concurrency: 15 NULL - └─Limit_19 0.26 0 cop[tikv] NULL NULL offset:0, count:100 - └─Selection_18 0.26 0 cop[tikv] NULL NULL eq(executor__issues.t.c, "abd") - └─TableFullScan_17 256.00 0 cop[tikv] table:t NULL keep order:true, stats:partial[c:unInitialized] +Limit_11 0.26 root NULL NULL offset:0, count:100 +└─TableReader_20 0.26 root NULL max_distsql_concurrency: 15 NULL + └─Limit_19 0.26 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_18 0.26 cop[tikv] NULL NULL eq(executor__issues.t.c, "abd") + └─TableFullScan_17 256.00 cop[tikv] table:t NULL keep order:true, stats:partial[c:unInitialized] select @@tidb_partition_prune_mode; @@tidb_partition_prune_mode dynamic explain analyze select * from pt order by id; # expected distsql concurrency 2 id estRows actRows task access object execution info operator info memory disk -TableReader_11 256.00 256 root partition:all max_distsql_concurrency: 2 NULL -└─TableFullScan_10 256.00 256 cop[tikv] table:pt NULL keep order:true +TableReader_11 256.00 root partition:all max_distsql_concurrency: 2 NULL +└─TableFullScan_10 256.00 cop[tikv] table:pt NULL keep order:true explain analyze select * from pt limit 100; # expected distsql concurrency 7 id estRows actRows task access object execution info operator info memory disk -Limit_7 100.00 100 root NULL NULL offset:0, count:100 -└─TableReader_11 100.00 107 root partition:all max_distsql_concurrency: 7 NULL - └─Limit_10 100.00 199 cop[tikv] NULL NULL offset:0, count:100 - └─TableFullScan_9 100.00 199 cop[tikv] table:pt NULL keep order:false +Limit_7 100.00 root NULL NULL offset:0, count:100 +└─TableReader_11 100.00 root partition:all max_distsql_concurrency: 7 NULL + └─Limit_10 100.00 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_9 100.00 cop[tikv] table:pt NULL keep order:false explain analyze select * from pt limit 100000; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_7 256.00 256 root NULL NULL offset:0, count:100000 -└─TableReader_11 256.00 256 root partition:all max_distsql_concurrency: 15 NULL - └─Limit_10 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 - └─TableFullScan_9 256.00 256 cop[tikv] table:pt NULL keep order:false +Limit_7 256.00 root NULL NULL offset:0, count:100000 +└─TableReader_11 256.00 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_10 256.00 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_9 256.00 cop[tikv] table:pt NULL keep order:false explain analyze select * from pt where val = 125 limit 100; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_8 100.00 0 root NULL NULL offset:0, count:100 -└─TableReader_13 100.00 0 root partition:all max_distsql_concurrency: 15 NULL - └─Limit_12 100.00 0 cop[tikv] NULL NULL offset:0, count:100 - └─Selection_11 100.00 0 cop[tikv] NULL NULL eq(executor__issues.pt.val, 125) - └─TableFullScan_10 125.00 0 cop[tikv] table:pt NULL keep order:false, stats:partial[val:missing] +Limit_8 100.00 root NULL NULL offset:0, count:100 +└─TableReader_13 100.00 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_12 100.00 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_11 100.00 cop[tikv] NULL NULL eq(executor__issues.pt.val, 125) + └─TableFullScan_10 125.00 cop[tikv] table:pt NULL keep order:false, stats:partial[val:missing] explain analyze select * from pt where val = 125 limit 100000; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_8 204.80 0 root NULL NULL offset:0, count:100000 -└─TableReader_13 204.80 0 root partition:all max_distsql_concurrency: 15 NULL - └─Limit_12 204.80 0 cop[tikv] NULL NULL offset:0, count:100000 - └─Selection_11 204.80 0 cop[tikv] NULL NULL eq(executor__issues.pt.val, 125) - └─TableFullScan_10 256.00 0 cop[tikv] table:pt NULL keep order:false, stats:partial[val:missing] +Limit_8 204.80 root NULL NULL offset:0, count:100000 +└─TableReader_13 204.80 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_12 204.80 cop[tikv] NULL NULL offset:0, count:100000 + └─Selection_11 204.80 cop[tikv] NULL NULL eq(executor__issues.pt.val, 125) + └─TableFullScan_10 256.00 cop[tikv] table:pt NULL keep order:false, stats:partial[val:missing] explain analyze select * from pt order by id limit 100; # expected distsql concurrency 7, but currently get 1, see issue #55190 id estRows actRows task access object execution info operator info memory disk -Limit_10 100.00 100 root NULL NULL offset:0, count:100 -└─TableReader_17 100.00 100 root partition:all max_distsql_concurrency: 1 NULL - └─Limit_16 100.00 256 cop[tikv] NULL NULL offset:0, count:100 - └─TableFullScan_15 100.00 256 cop[tikv] table:pt NULL keep order:true +Limit_10 100.00 root NULL NULL offset:0, count:100 +└─TableReader_17 100.00 root partition:all max_distsql_concurrency: 1 NULL + └─Limit_16 100.00 cop[tikv] NULL NULL offset:0, count:100 + └─TableFullScan_15 100.00 cop[tikv] table:pt NULL keep order:true explain analyze select * from pt order by id limit 100000; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_11 256.00 256 root NULL NULL offset:0, count:100000 -└─TableReader_21 256.00 256 root partition:all max_distsql_concurrency: 15 NULL - └─Limit_20 256.00 256 cop[tikv] NULL NULL offset:0, count:100000 - └─TableFullScan_19 256.00 256 cop[tikv] table:pt NULL keep order:true +Limit_11 256.00 root NULL NULL offset:0, count:100000 +└─TableReader_21 256.00 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_20 256.00 cop[tikv] NULL NULL offset:0, count:100000 + └─TableFullScan_19 256.00 cop[tikv] table:pt NULL keep order:true explain analyze select * from pt where val = 126 order by id limit 100; # expected distsql concurrency 15 id estRows actRows task access object execution info operator info memory disk -Limit_11 100.00 0 root NULL NULL offset:0, count:100 -└─TableReader_20 100.00 0 root partition:all max_distsql_concurrency: 15 NULL - └─Limit_19 100.00 0 cop[tikv] NULL NULL offset:0, count:100 - └─Selection_18 100.00 0 cop[tikv] NULL NULL eq(executor__issues.pt.val, 126) - └─TableFullScan_17 125.00 0 cop[tikv] table:pt NULL keep order:true, stats:partial[val:missing] +Limit_11 100.00 root NULL NULL offset:0, count:100 +└─TableReader_20 100.00 root partition:all max_distsql_concurrency: 15 NULL + └─Limit_19 100.00 cop[tikv] NULL NULL offset:0, count:100 + └─Selection_18 100.00 cop[tikv] NULL NULL eq(executor__issues.pt.val, 126) + └─TableFullScan_17 125.00 cop[tikv] table:pt NULL keep order:true, stats:partial[val:missing] diff --git a/tests/integrationtest/t/executor/issues.test b/tests/integrationtest/t/executor/issues.test index cd44db622a7c8..99597f35ad9fc 100644 --- a/tests/integrationtest/t/executor/issues.test +++ b/tests/integrationtest/t/executor/issues.test @@ -700,68 +700,68 @@ split table pt between (0) and (40960) regions 30; analyze table pt; set @@tidb_distsql_scan_concurrency = default; --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t order by id; # expected distsql concurrency 2 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t limit 100; # expected distsql concurrency 1 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t limit 100000; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t where c = 'abc' limit 100; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t where c = 'abc' limit 100000; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t order by id limit 100; # expected distsql concurrency 1 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t order by id limit 100000; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from t where c = 'abd' order by id limit 100; select @@tidb_partition_prune_mode; --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt order by id; # expected distsql concurrency 2 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt limit 100; # expected distsql concurrency 7 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt limit 100000; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt where val = 125 limit 100; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt where val = 125 limit 100000; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt order by id limit 100; # expected distsql concurrency 7, but currently get 1, see issue #55190 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt order by id limit 100000; # expected distsql concurrency 15 --- replace_column 8 9 +-- replace_column 8 9 3 -- replace_regex /.*max_distsql_concurrency: (?P[0-9]+).*/max_distsql_concurrency: $num/ /tikv_task:.*// /time:.*// /data:.*// explain analyze select * from pt where val = 126 order by id limit 100; # expected distsql concurrency 15