branch-4.1: [fix](be) Clean up spill directories during query teardown - #66458
Merged
yiguolei merged 2 commits intoAug 6, 2026
Merged
Conversation
Backport the spill-directory cleanup from apache#66328: - record each spill data root before opening the first spill part; - delete touched per-query spill directories during QueryContext teardown; - retain failed deletions and retry them from spill GC and shutdown paths; - keep no-spill queries on the zero-cleanup fast path. The recursive CTE and FragmentMgr lifecycle changes from the original PR are intentionally excluded because branch-4.1 has divergent recursive CTE code. Spill cleanup for that lifecycle remains out of scope. (cherry picked from commit 3dff55a)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Member
Author
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
mrhhsg
marked this pull request as ready for review
August 6, 2026 09:21
Member
Author
|
/review |
yiguolei
approved these changes
Aug 6, 2026
Contributor
|
Codex automated review failed and did not complete. Error: All Codex review accounts are usage-limited; earliest retry is 2026-08-08T03:32:00Z. Please trigger /review again after that time. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: None
Related PR: #66328
Problem Summary:
Backport the spill query-directory cleanup from #66328 to
branch-4.1.This change:
QueryContextteardown;The recursive CTE and
FragmentMgrlifecycle changes from the original PR are intentionally excluded because thebranch-4.1implementation diverges. Spill cleanup for query contexts retained by that lifecycle remains out of scope for this backport.Release note
None
Check List (For Author)
Test
./build.sh --be --fesucceeded.doris-local-regression run -d spill_p0 -s test_spill_directory_cleanup(1/1 passed, then rerun 1/1 passed).spill_disk_has_spill_datatransition from0to1and back to0after query cleanup.doris_be_testtarget compiled and linked successfully../run-be-ut.sh --run --filter='SpillFileTest.GCCleansUpFiles:SpillFileTest.QueryContextDeletesEmptySpillDirectory:SpillFileTest.QueryContextCleansUpNestedSpillDirectory:SpillFileTest.QueryContextDeletesResidualSpillDirectory:SpillFileTest.QueryContextCleansUpAllTouchedSpillDirectories:SpillFileTest.QueryContextContinuesCleanupAfterRootFailure:SpillFileTest.QueryContextRetriesSpillDirectoryDeletionUntilSuccess:SpillFileTest.RetryPreservesDirectoryQueuedAfterPendingDrain:SpillFileTest.QueryContextSkipsCleanupWithoutSpill:SpillFileTest.DeleteSpillFileThroughManagerSynchronously' -j 64(10/10 passed, then rerun 10/10 passed)build-support/check-format.sh(passed)git diff --check(passed)Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)