forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add memory reclaim max wait timeout plus spill improvement (facebooki…
…ncubator#7761) Summary: In Meta internal test, we found in some rare case the bug in parallel join build can get stuck in an infinite loop. If memory arbitration decides to reclaim from this query, then the task pause will hang forever as the parallel join build driver thread will keep running on the thread. Once this happens, the entire worker will get stuck as eventually all the driver threads will be blocked by the memory arbitration as the query executions will keep asking for memory arbitration. Instead of hanging the entire worker query execution, it might be better to provide a configurable option to time out the task pause wait during memory reclaim. Therefore, if there is a hanging query, then the memory arbitration simply fails the memory reclaim which in turn fails the hanging query execution. This PR adds an option in memory arbitration to specify the max memory reclaim timeout. The actual memory reclaim implementation can choose to respect the timeout or not. The task memory reclaimer respect the timeout when wait for the task to pause. If timed out, it will fail the memory reclaim on this task. We also add stats counter to report the timeout event for monitoring so we can catch this in production if it happens. We also add a timeout when the task memory pool aborts the task execution as the victim task can be a hanging task as well. Add unit test to verify and catch this behavior. We also improve the hash build memory reservation when the build table is empty to avoid the flakiness in the test which should also help in production. Pull Request resolved: facebookincubator#7761 Reviewed By: mbasmanova Differential Revision: D51650322 Pulled By: xiaoxmeng fbshipit-source-id: 9c16b928cac2c584831520d331eb7f7fcd3e263b
- Loading branch information
1 parent
e3243c5
commit 2dc97de
Showing
34 changed files
with
398 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.