-
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
RFC + executor: Support global memory tracker #16777
Conversation
Thanks for your contribution. If your PR get merged, you will be rewarded 3488 points. |
/run-all-tests |
/run-unit-test |
t.parMu.Lock() | ||
defer t.parMu.Unlock() |
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.
Why don't we lock the parent in functions like Consume
, instead, to lock it here?
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.
Lock parent
is my first trial when I found the data race error, maybe adding lock in the Consume
function is also enough. But the tpcc test result already seems ok if we lock parent
here.
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
/run-all-tests |
@Yisaer Would you like to add documentation related to this PR? |
@SunRunAway ok. |
Benchmark Report
@@ Benchmark Diff @@
================================================================================
--- tidb: 3f2d35a60bbc37382d991ecbcd48ebec9b6a3f8c
+++ tidb: 12596f1a74b6a6c4079423536817a57c4b853c7d
tikv: 58e5b3a1f39bf6473b06ed41c3371b64c7c374be
pd: 0e3d21884c952afe96af96b8c4f0ef851d5a9204
================================================================================
oltp_update_index:
* QPS: 4449.87 ± 3.83% (std=104.04) delta: 1.51% (p=0.593)
* Latency p50: 28.78 ± 3.94% (std=0.69) delta: -1.59%
* Latency p99: 54.62 ± 5.95% (std=2.04) delta: -3.13%
oltp_insert:
* QPS: 7102.58 ± 0.41% (std=17.68) delta: -0.06% (p=0.860)
* Latency p50: 17.99 ± 0.13% (std=0.02) delta: -0.08%
* Latency p99: 31.09 ± 0.90% (std=0.28) delta: -0.04%
oltp_read_write:
* QPS: 14392.08 ± 0.03% (std=3.79) delta: -0.16% (p=0.842)
* Latency p50: 178.17 ± 0.13% (std=0.15) delta: 0.12%
* Latency p99: 331.91 ± 0.00% (std=0.00) delta: -0.58%
oltp_point_select:
* QPS: 41406.07 ± 0.08% (std=25.29) delta: 3.20% (p=0.143)
* Latency p50: 3.09 ± 0.00% (std=0.00) delta: -3.13%
* Latency p99: 10.60 ± 2.24% (std=0.16) delta: -1.78%
oltp_update_non_index:
* QPS: 4732.56 ± 6.86% (std=201.32) delta: -3.38% (p=0.619)
* Latency p50: 27.09 ± 7.18% (std=1.19) delta: 3.68%
* Latency p99: 41.35 ± 1.21% (std=0.35) delta: 0.10%
|
/label needs-cherry-pick-4.0 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #19861 |
@Yisaer @SunRunAway Is there any QA test to cover this new change? |
BTW, please add a user document for it. |
Since @Yisaer has contributed a lot to sig-exec, according to sig-exec [roles-and-organization-management.md#promotion](https://github.com/pingcap/community/blob/master/special-interest-groups/sig-exec/roles-and-organization-management.md#from-reviewer-to-committer), we would like to promote him to our new committer, and his detailed contribution is shown below: 1. contribute [20+](https://github.com/pingcap/tidb/pulls?q=is%3Apr+author%3Ayisaer+label%3Astatus%2Fcan-merge+label%3Asig%2Fexecution) PRs to the executor, 2. support the [global memory tracker](pingcap/tidb#16777) (a medium task) 4. support the ratelimit action to solve the [table reader oom problem](pingcap/tidb#16104) (a hard task) 5. help other contributors and review [25+](https://github.com/pingcap/tidb/pulls?q=is%3Apr+reviewed-by%3Ayisaer+-author%3Ayisaer) PRs. Thanks for his contribution!!
Since @Yisaer has contributed a lot to sig-exec, according to sig-exec [roles-and-organization-management.md#promotion](https://github.com/pingcap/community/blob/master/special-interest-groups/sig-exec/roles-and-organization-management.md#from-reviewer-to-committer), we would like to promote him to our new committer, and his detailed contribution is shown below: 1. contribute [20+](https://github.com/pingcap/tidb/pulls?q=is%3Apr+author%3Ayisaer+label%3Astatus%2Fcan-merge+label%3Asig%2Fexecution) PRs to the executor, 2. support the [global memory tracker](pingcap/tidb#16777) (a medium task) 4. support the ratelimit action to solve the [table reader oom problem](pingcap/tidb#16104) (a hard task) 5. help other contributors and review [25+](https://github.com/pingcap/tidb/pulls?q=is%3Apr+reviewed-by%3Ayisaer+-author%3Ayisaer) PRs. Thanks for his contribution!!
Since @Yisaer has contributed a lot to sig-exec, according to sig-exec [roles-and-organization-management.md#promotion](https://github.com/pingcap/community/blob/master/special-interest-groups/sig-exec/roles-and-organization-management.md#from-reviewer-to-committer), we would like to promote him to our new committer, and his detailed contribution is shown below: 1. contribute [20+](https://github.com/pingcap/tidb/pulls?q=is%3Apr+author%3Ayisaer+label%3Astatus%2Fcan-merge+label%3Asig%2Fexecution) PRs to the executor, 2. support the [global memory tracker](pingcap/tidb#16777) (a medium task) 4. support the ratelimit action to solve the [table reader oom problem](pingcap/tidb#16104) (a hard task) 5. help other contributors and review [25+](https://github.com/pingcap/tidb/pulls?q=is%3Apr+reviewed-by%3Ayisaer+-author%3Ayisaer) PRs. Thanks for his contribution!!
What problem does this PR solve?
UCP: #15407
Issue Number: close #15407
Support Global Memory tracker to control the memory usage and kill the current session's if the global memory usage in tracker exceeds the limit.
What is changed and how it works?
Currently, we have already support the Global Disk Tracker for
Executor
And the Support of Global memory Tracker forExecutor
is quite likely the same.Proposal
see #17103
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Release note