Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #59330

… 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 -->
@github-actions github-actions bot requested a review from yiguolei as a code owner December 29, 2025 06:29
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Dec 29, 2025
@hello-stephen
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 82.10% (1573/1916)
Line Coverage 67.09% (28059/41824)
Region Coverage 67.56% (13799/20426)
Branch Coverage 57.99% (7356/12684)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 51.32% (78/152) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.35% (18666/34989)
Line Coverage 39.13% (172926/441976)
Region Coverage 33.75% (133467/395425)
Branch Coverage 34.77% (57773/166141)

@yiguolei yiguolei merged commit 63d936f into branch-4.0 Dec 30, 2025
23 of 27 checks passed
@github-actions github-actions bot deleted the auto-pick-59330-branch-4.0 branch December 30, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants