-
Notifications
You must be signed in to change notification settings - Fork 6.1k
executor, util/memory: keep global analyze memory usage non-negative #65503
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
base: master
Are you sure you want to change the base?
executor, util/memory: keep global analyze memory usage non-negative #65503
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #65503 +/- ##
================================================
- Coverage 70.8020% 66.3495% -4.4526%
================================================
Files 1901 1958 +57
Lines 518502 538869 +20367
================================================
- Hits 367110 357537 -9573
- Misses 126860 158634 +31774
+ Partials 24532 22698 -1834
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| defer e.memTracker.Consume(bufferedMemSize) | ||
| defer e.memTracker.Release(bufferedReleaseSize) |
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.
in this version, we always consume 0 and release 0, as arguments of defer is computed before defer function called
|
Addressed the review comment from @D3Hunter: the worker cleanup now uses a deferred closure so |
|
/retest-required |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: winoros The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/hold for discussing changes around the test case |
| tk.MustExec("set @@tidb_build_sampling_stats_concurrency=1") | ||
| tk.MustExec("use test") | ||
| tk.MustExec("drop table if exists t_mem_usage") | ||
| tk.MustExec("create table t_mem_usage(a text collate utf8mb4_general_ci)") |
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.
We can
- Change the type to
varcharor - Do an explicit set for the var
tidb_analyze_skip_column_typesto ensure that we will not skip the text type when building stats.
|
@wjhuang2016: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/unhold |
|
@wjhuang2016: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #65502
Problem Summary:
Global analyze memory "in-use" can temporarily become negative during Analyze v2 due to cleanup order, which may lead to confusing metrics and violates invariants in internal-check builds.
What changed and how does it work?
LabelForGlobalAnalyzeMemory(in-use) is never negative.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.