-
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: exit all goroutines immediately when exceeded mem-quota #37405
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/0d742287b8b17b9a035bc06217c52aa222d3fc4b |
cc028ea
to
a0b9096
Compare
1e8b195
to
0d74228
Compare
"select /*+ HASH_JOIN(t1) */ /*+ USE_INDEX(t1,idx) */ /*+ USE_INDEX(t2,idx) */ * from t t1 join t t2 on t1.a=t2.a", // HashJoin | ||
"select /*+ MERGE_JOIN(t1) */ /*+ USE_INDEX(t1,idx) */ /*+ USE_INDEX(t2,idx) */ * from t t1 join t t2 on t1.a=t2.a", // Shuffle+MergeJoin | ||
"select /*+ INL_JOIN(t2) */ * from t t1 join t t2 on t1.a=t2.a;", // Index Join | ||
"select /*+ INL_HASH_JOIN(t2) */ * from t t1 join t t2 on t1.a=t2.a;", // Index Hash Join |
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.
It seems we do not inject the random panic for inl_hash_join?
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 66fa79b
|
TiDB MergeCI notify✅ Well Done! New fixed [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #37379
Problem Summary:
Now if one sql use too many memory, it will panic and exit. But some goroutines maybe not exit immediately and continue to alloc memory.
We need exit all related goroutines and check it will not cause other problems, e.g. deadlock.
What is changed and how it works?
iw.lookup.workerWg.Add(1)
out from the new goroutine, to avoid panic "sync: WaitGroup is reused before previous Wait has returned"defer closeBaseExecutor(&e.baseExecutor)
from AggExec.Open(), to avoid memory leak.For example,
If HashAgg_35 panic in Open(), HashAgg_29 will recover and call Close() function in
closeBaseExecutor
Now, we have two ways to do follow-up resource release work
Both of these methods have problems, so I remove this function
closeBaseExecutor
and Close() Projection_13 directly.Benchmark
TPCH-50g q18
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.