Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topsql: add more test case for topsql #32410

Merged
merged 76 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
8c2e493
init
crazycs520 Feb 11, 2022
76495e7
todo: fix multi-statements test
crazycs520 Feb 11, 2022
b35dfed
try fix
crazycs520 Feb 14, 2022
19c9ed2
add multi-statements test
crazycs520 Feb 14, 2022
e3ec7e1
add compile test
crazycs520 Feb 14, 2022
428dfd0
refine
crazycs520 Feb 14, 2022
aa9bf31
add ddl test
crazycs520 Feb 14, 2022
13bcfc1
add test for topsql stmt stats
crazycs520 Feb 15, 2022
6921a85
add big query test
crazycs520 Feb 15, 2022
a207609
speed up test
crazycs520 Feb 15, 2022
60fcb83
make test stable
crazycs520 Feb 15, 2022
9a37474
add wrong syntax test
crazycs520 Feb 15, 2022
630f2f3
add test case for execute failed cause by storage error
crazycs520 Feb 16, 2022
5f7c2c2
add test case for execute in plan stage
crazycs520 Feb 16, 2022
ec8499a
refine
crazycs520 Feb 16, 2022
73f5b07
Merge branch 'master' into topsql-test2
crazycs520 Feb 16, 2022
8773f0e
fix typo
crazycs520 Feb 18, 2022
c19b017
Merge branch 'master' into topsql-test2
crazycs520 Feb 18, 2022
3591d7e
refine wait logic in test
crazycs520 Feb 18, 2022
9488333
Merge branch 'master' into topsql-test2
crazycs520 Feb 18, 2022
e608fc1
fix ci lint
crazycs520 Feb 18, 2022
fcb77fe
Merge branch 'master' into topsql-test2
crazycs520 Feb 18, 2022
e3abf4f
Merge branch 'master' into topsql-test2
crazycs520 Feb 18, 2022
5dbc028
make test stable
crazycs520 Feb 18, 2022
3f7cfcb
Merge branch 'master' into topsql-test2
crazycs520 Feb 18, 2022
ca9f192
Merge branch 'master' into topsql-test2
crazycs520 Feb 21, 2022
84439ad
add prepare test case
crazycs520 Feb 21, 2022
ea0acf7
Merge branch 'master' into topsql-test2
crazycs520 Feb 21, 2022
eb7639b
Merge branch 'master' into topsql-test2
crazycs520 Feb 21, 2022
fbf8e8a
Merge branch 'master' into topsql-test2
crazycs520 Feb 21, 2022
383e23d
Merge branch 'master' of https://github.com/pingcap/tidb into topsql-…
crazycs520 Feb 22, 2022
7be5d0d
Merge branch 'master' into topsql-test2
crazycs520 Feb 22, 2022
380102d
Merge branch 'master' into topsql-test2
crazycs520 Feb 22, 2022
e31ef61
Merge branch 'master' into topsql-test2
crazycs520 Feb 22, 2022
f303c4c
Merge branch 'master' into topsql-test2
crazycs520 Feb 24, 2022
aa396d2
try make test stable
crazycs520 Feb 24, 2022
8ef3ea3
Merge branch 'master' into topsql-test2
crazycs520 Feb 24, 2022
c1e62b2
Merge branch 'master' into topsql-test2
crazycs520 Feb 24, 2022
221bcb0
Merge branch 'master' into topsql-test2
crazycs520 Feb 25, 2022
fff9de8
Merge branch 'master' into topsql-test2
crazycs520 Feb 25, 2022
acf2789
Merge branch 'master' into topsql-test2
crazycs520 Feb 25, 2022
260191d
Merge branch 'master' into topsql-test2
crazycs520 Feb 28, 2022
cf03da1
Merge branch 'master' into topsql-test2
crazycs520 Feb 28, 2022
0f8fe45
resolve comment
crazycs520 Feb 28, 2022
8a6e3e9
Merge branch 'master' into topsql-test2
crazycs520 Feb 28, 2022
dc18e1a
Merge branch 'master' into topsql-test2
crazycs520 Mar 1, 2022
7aff728
Merge branch 'master' into topsql-test2
crazycs520 Mar 1, 2022
591e165
Merge branch 'master' into topsql-test2
crazycs520 Mar 1, 2022
a2d5cc1
Merge branch 'master' into topsql-test2
crazycs520 Mar 1, 2022
cf5c86b
Merge branch 'master' into topsql-test2
crazycs520 Mar 1, 2022
daee47f
Merge branch 'master' into topsql-test2
crazycs520 Mar 2, 2022
f245bc2
Merge branch 'master' into topsql-test2
crazycs520 Mar 2, 2022
e3bc938
Merge branch 'master' into topsql-test2
crazycs520 Mar 2, 2022
678f3c5
Merge branch 'master' into topsql-test2
crazycs520 Mar 2, 2022
46c7618
Merge branch 'master' into topsql-test2
crazycs520 Mar 7, 2022
57bfe22
Merge branch 'master' into topsql-test2
crazycs520 Mar 7, 2022
9189d98
Merge branch 'master' into topsql-test2
crazycs520 Mar 8, 2022
df726ae
Merge branch 'master' into topsql-test2
crazycs520 Mar 9, 2022
c2499aa
Merge branch 'master' into topsql-test2
crazycs520 Mar 9, 2022
6da15e5
address comment
crazycs520 Mar 10, 2022
d957f97
Merge branch 'master' into topsql-test2
crazycs520 Mar 10, 2022
a967045
Merge branch 'master' into topsql-test2
crazycs520 Mar 10, 2022
83b16fa
refine
zhongzc Mar 10, 2022
ca8cd51
address
zhongzc Mar 10, 2022
7dd1a7d
multi
zhongzc Mar 10, 2022
d65dc3e
Merge pull request #2 from zhongzc/pr/32410
crazycs520 Mar 10, 2022
908c815
Merge branch 'master' into topsql-test2
crazycs520 Mar 10, 2022
7da18a0
refine test
crazycs520 Mar 10, 2022
61f317b
Merge branch 'topsql-test2' of https://github.com/crazycs520/tidb int…
crazycs520 Mar 10, 2022
d2c00d7
fix test
crazycs520 Mar 11, 2022
a4c63ae
address comment
crazycs520 Mar 11, 2022
c104fac
Merge branch 'master' into topsql-test2
crazycs520 Mar 11, 2022
b90fc23
Merge branch 'master' into topsql-test2
ti-chi-bot Mar 11, 2022
251c6ad
Merge branch 'master' into topsql-test2
ti-chi-bot Mar 11, 2022
3772406
Merge branch 'master' into topsql-test2
ti-chi-bot Mar 11, 2022
2c22412
Merge branch 'master' into topsql-test2
ti-chi-bot Mar 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/pingcap/tidb/util/logutil"
decoder "github.com/pingcap/tidb/util/rowDecoder"
"github.com/pingcap/tidb/util/timeutil"
"github.com/pingcap/tidb/util/topsql"
"github.com/tikv/client-go/v2/tikv"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -311,6 +312,11 @@ func (w *backfillWorker) run(d *ddlCtx, bf backfiller, job *model.Job) {
}
})

failpoint.Inject("mockHighLoadForAddIndex", func() {
sqlPrefixes := []string{"alter"}
topsql.MockHighCPULoad(job.Query, sqlPrefixes, 5)
})

// Dynamic change batch size.
w.batchCnt = int(variable.GetDDLReorgBatchSize())
result := w.handleBackfillTask(d, task, bf)
Expand Down
6 changes: 6 additions & 0 deletions executor/table_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ package executor
import (
"context"
"sort"
"time"

"github.com/opentracing/opentracing-go"
"github.com/pingcap/failpoint"
"github.com/pingcap/tidb/distsql"
"github.com/pingcap/tidb/expression"
"github.com/pingcap/tidb/kv"
Expand Down Expand Up @@ -125,6 +127,10 @@ func (e *TableReaderExecutor) Open(ctx context.Context) error {
defer span1.Finish()
ctx = opentracing.ContextWithSpan(ctx, span1)
}
failpoint.Inject("mockSleepInTableReaderNext", func(v failpoint.Value) {
ms := v.(int)
time.Sleep(time.Millisecond * time.Duration(ms))
})

e.memTracker = memory.NewTracker(e.id, -1)
e.memTracker.AttachTo(e.ctx.GetSessionVars().StmtCtx.MemTracker)
Expand Down
6 changes: 6 additions & 0 deletions planner/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
"github.com/pingcap/tidb/util/hint"
"github.com/pingcap/tidb/util/logutil"
utilparser "github.com/pingcap/tidb/util/parser"
"github.com/pingcap/tidb/util/topsql"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -321,6 +322,11 @@ func optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in
failpoint.Return(nil, nil, 0, errors.New("gofail wrong optimizerCnt error"))
}
})
failpoint.Inject("mockHighLoadForOptimize", func() {
sqlPrefixes := []string{"select"}
topsql.MockHighCPULoad(sctx.GetSessionVars().StmtCtx.OriginalSQL, sqlPrefixes, 10)
})

// build logical plan
sctx.GetSessionVars().PlanID = 0
sctx.GetSessionVars().PlanColumnID = 0
Expand Down
Loading