-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: add concurrency limit on union executor #19827
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
LGTM |
return | ||
case result.chk = <-e.resourcePools[workerID]: | ||
} | ||
result.err = Next(ctx, e.children[childID], result.chk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and can we make children[childID]
's Open
call be lazy to the time before first invokes Next
?
we also have a problem that limit 1 but buildRange for all partitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a try to open children executor in resultPuller, but get race in test.
Any idea to fix it?
[2020-09-07T06:00:55.991Z] WARNING: DATA RACE
[2020-09-07T06:00:55.991Z] Write at 0x00c0936a8b30 by goroutine 517:
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/store/tikv.(*tikvSnapshot).SetOption()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/tikv/snapshot.go:468 +0x3e8
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*BatchPointGetExec).Open()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/batch_point_get.go:111 +0x8b3
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*UnionExec).resultPuller()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1470 +0x775
[2020-09-07T06:00:55.991Z]
[2020-09-07T06:00:55.991Z] Previous read at 0x00c0936a8b30 by goroutine 1012:
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/store/tikv.(*tikvSnapshot).batchGetSingleRegion()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/tikv/snapshot.go:243 +0x178
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/store/tikv.(*tikvSnapshot).batchGetKeysByRegions()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/tikv/snapshot.go:214 +0xa2a
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/store/tikv.(*tikvSnapshot).BatchGet()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/store/tikv/snapshot.go:140 +0x715
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/kv.(*BufferBatchGetter).BatchGet()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/kv/utils.go:102 +0x99b
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*BatchPointGetExec).initialize()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/batch_point_get.go:301 +0xc40
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*BatchPointGetExec).Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/batch_point_get.go:141 +0x819
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:268 +0x27d
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*ProjectionExec).unParallelExecute()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:187 +0x1db
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*ProjectionExec).Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:173 +0xa9
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:268 +0x27d
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*UnionExec).resultPuller()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1485 +0x4df
[2020-09-07T06:00:55.991Z]
[2020-09-07T06:00:55.991Z] Goroutine 517 (running) created at:
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*UnionExec).initialize()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1442 +0x548
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*UnionExec).Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1503 +0x520
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:268 +0x27d
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/executor.(*recordSet).Next()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:127 +0x110
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/session.(*execStmtResult).Next()
[2020-09-07T06:00:55.991Z] <autogenerated>:1 +0x84
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/session.GetRows4Test()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:282 +0x35a
[2020-09-07T06:00:55.991Z] github.com/pingcap/tidb/session.ResultSetToStringSlice()
[2020-09-07T06:00:55.991Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:300 +0xb8
[2020-09-07T06:00:55.992Z] [2020/09/07 14:00:55.774 +08:00] [INFO] [ddl.go:517] ["[ddl] DDL job is finished"] [jobID=73]
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResultWithCtx()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:311 +0xa8
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/util/testkit.(*TestKit).MustQuery()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:306 +0x4e4
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor_test.(*testPointGetSuite).TestClusterIndexCBOPointGet()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/point_get_test.go:586 +0x4b4
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor_test.(*testPointGetSuite).TestClusterIndexCBOPointGet()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/point_get_test.go:572 +0x1cf
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor_test.(*testPointGetSuite).TestClusterIndexCBOPointGet()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/point_get_test.go:571 +0x198
[2020-09-07T06:00:55.992Z] [2020/09/07 14:00:55.779 +08:00] [INFO] [domain.go:646] ["performing DDL change, must reload"]
[2020-09-07T06:00:55.992Z] runtime.call32()
[2020-09-07T06:00:55.992Z] /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2020-09-07T06:00:55.992Z] reflect.Value.Call()
[2020-09-07T06:00:55.992Z] /usr/local/go/src/reflect/value.go:321 +0xd3
[2020-09-07T06:00:55.992Z] github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0x9aa
[2020-09-07T06:00:55.992Z] github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x113
[2020-09-07T06:00:55.992Z]
[2020-09-07T06:00:55.992Z] Goroutine 1012 (running) created at:
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor.(*UnionExec).initialize()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1442 +0x548
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor.(*UnionExec).Next()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:1503 +0x520
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor.Next()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:268 +0x27d
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor.(*recordSet).Next()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:127 +0x110
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/session.(*execStmtResult).Next()
[2020-09-07T06:00:55.992Z] <autogenerated>:1 +0x84
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/session.GetRows4Test()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:282 +0x35a
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/session.ResultSetToStringSlice()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:300 +0xb8
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResultWithCtx()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:311 +0xa8
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/util/testkit.(*TestKit).MustQuery()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:306 +0x4e4
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor_test.(*testPointGetSuite).TestClusterIndexCBOPointGet()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/point_get_test.go:586 +0x4b4
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor_test.(*testPointGetSuite).TestClusterIndexCBOPointGet()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/point_get_test.go:572 +0x1cf
[2020-09-07T06:00:55.992Z] github.com/pingcap/tidb/executor_test.(*testPointGetSuite).TestClusterIndexCBOPointGet()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/point_get_test.go:571 +0x198
[2020-09-07T06:00:55.992Z] runtime.call32()
[2020-09-07T06:00:55.992Z] /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2020-09-07T06:00:55.992Z] reflect.Value.Call()
[2020-09-07T06:00:55.992Z] /usr/local/go/src/reflect/value.go:321 +0xd3
[2020-09-07T06:00:55.992Z] github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0x9aa
[2020-09-07T06:00:55.992Z] github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2020-09-07T06:00:55.992Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x113
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh...- - maybe we could solve this problem later..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
/merge |
/run-all-tests |
@wshwsh12 merge failed. |
/run-mybatis-test |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-3.0 in PR #19885 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #19886 |
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note