fix(scheduler): reclaim intermediate shuffle data under AQE#2149
Draft
andygrove wants to merge 1 commit into
Draft
fix(scheduler): reclaim intermediate shuffle data under AQE#2149andygrove wants to merge 1 commit into
andygrove wants to merge 1 commit into
Conversation
The adaptive planner creates stages incrementally and never populates `output_links`, so the default `intermediate_stage_ids()` classified every AQE stage as final and the on-success reclaim did nothing. Derive the final stage(s) from `output_locations` instead, which carry the terminal stage id of each output partition. When `output_locations` is empty the job has not finished producing output, so reclaim nothing.
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.
Which issue does this PR close?
Closes #1996.
Rationale for this change
#1982 reclaims a job's intermediate shuffle data as soon as the job succeeds, instead of waiting for
finished_job_data_clean_up_interval_seconds(default 300s). It picks the stages to reclaim withExecutionGraph::intermediate_stage_ids(), which selects stages whoseoutput_linksis non-empty.That works for
StaticExecutionGraph, whereExecutionStageBuilderfills inoutput_linksup front. It does not work forAdaptiveExecutionGraph. The adaptive planner creates stages incrementally increate_resolved_stageand always passesvec![]foroutput_links("we do not know output links at this moment"), and nothing ever back-fills it. So under AQE every stage looks final, the intermediate set is empty, and the immediate reclaim is a no-op. The job then falls back to the delayed whole-job cleanup, which for a short benchmark run never fires before the disk fills up.This is the AQE-on half of the SF10 CI job in #1981 getting no relief at all. It showed up again on #2064, where query 21 failed with
No space left on device (os error 28)while the AQE-off leg passed.What changes are included in this PR?
Override
intermediate_stage_ids()forAdaptiveExecutionGraphto derive the final stages fromoutput_locationsrather thanoutput_links. EachPartitionLocationcarries the terminalstage_idthat produced it, so the final set is the stage ids present inoutput_locationsand everything else is intermediate.output_locationsis only populated once the planner has no more stages to run, so while the job is still running it is empty and the override returns an empty set. That preserves the "never delete a final stage" invariant from #1982.Adds an AQE test that drives a multi-stage adaptive job to success and asserts that
intermediate_stage_ids()returns exactly the non-terminal stages, that it is disjoint from the stages inoutput_locations, and that it is empty before the job produces output.Are there any user-facing changes?
No API changes. Jobs running under the adaptive planner now free their intermediate shuffle files as soon as the job succeeds, matching the behavior the static planner already had.