Commit af4e2dd
authored
[enhancement](spilldisk)Cancel query fast when reserver memory failed and could not find revocable tasks (#59330)
### What problem does this PR solve?
There are some problems in the previous code:
1. revocable memory size is ineffective for non-spill operators and
remains 0 in all cases. In this scenario, if we disable spill and enable
reserve, it appears that memlimit will stop working entirely.
2. too complicated in process reserve failed.
In this PR, I simplified the logic:
1. If the query is not enable spill, and if reserve memory failed, just
disable reserve memory and it will enable memory check immediately and
let the query run.
2. If reserve memory failed and not find any revocable tasks, then just
cancel the query.
3. If reserve memory failed, should add to paused query immediately
because it maybe the last block for join build. If not paused, it may
try to allocate a lot of memory.
4. If there are some query in cancel stage, then not check paused query
for a bit while because the cancelling query may release some memory.
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->1 parent 6377254 commit af4e2dd
File tree
10 files changed
+405
-243
lines changed- be
- src
- pipeline
- runtime
- memory
- workload_group
- workload_management
- test
- pipeline
- runtime/workload_group
- gensrc/thrift
10 files changed
+405
-243
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
643 | 651 | | |
644 | 652 | | |
645 | 653 | | |
| |||
656 | 664 | | |
657 | 665 | | |
658 | 666 | | |
659 | | - | |
| 667 | + | |
660 | 668 | | |
661 | 669 | | |
662 | 670 | | |
663 | 671 | | |
664 | | - | |
665 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
666 | 691 | | |
667 | 692 | | |
668 | 693 | | |
| |||
674 | 699 | | |
675 | 700 | | |
676 | 701 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | 702 | | |
681 | | - | |
| 703 | + | |
682 | 704 | | |
683 | 705 | | |
684 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
298 | 297 | | |
299 | 298 | | |
300 | 299 | | |
301 | | - | |
| 300 | + | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
| |||
0 commit comments