-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Fix forever hanging when HashAgg is called by apply #12760
Conversation
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #12760 +/- ##
===========================================
Coverage 79.9575% 79.9575%
===========================================
Files 462 462
Lines 105416 105416
===========================================
Hits 84288 84288
Misses 14902 14902
Partials 6226 6226 |
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
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
cherry pick to release-3.1 failed |
cherry pick to release-3.0 failed |
cherry pick to release-2.1 failed |
…upstream-release-2.1
What problem does this PR solve?
Fix #12759
What is changed and how it works?
The parent executors(apply) of HashAgg may call
HashAgg.Next
once more to make sure the returned size of chunk is 0.HashAgg.Next
handle these calls incorrectly after its allfinalWorks
exits.On each call of
HashAgg.Next
after the job done, it returns a chunk with 0 size, but put a chk intofinalInputCh
. Each apply executor will call aHashAgg.Next
once more, when the number of parent executors exceeds the channel buffer, the query will hang forever.Explain the example in #12759,
HashAgg.Next
which returns a one-row chunk to its parent, sends the chunk into the buffer (This is valid).HashAgg.Next
called by each of the three apply, which returns a zero-row chunk to its parent, sends the chunk into the buffer (This should not happen).HashAgg.Next
called by the session of tidb, which returns a zero-row chunk to its parent, sends the chunk into the buffer and hangs forever.Check List
Tests
Code changes
Side effects
Related changes
Release note