Spark: Stop async preload when either limit is reached - #17950
Open
iamrajatrana wants to merge 3 commits into
Open
Spark: Stop async preload when either limit is reached#17950iamrajatrana wants to merge 3 commits into
iamrajatrana wants to merge 3 commits into
Conversation
iamrajatrana
force-pushed
the
spark-fix-async-preload-limits
branch
from
September 4, 2026 20:36
7e0fd54 to
60995ac
Compare
iamrajatrana
marked this pull request as ready for review
September 4, 2026 20:39
uros-b
reviewed
Sep 5, 2026
uros-b
left a comment
Member
There was a problem hiding this comment.
Makes sense overall, and seems correct and well scoped - thank you @iamrajatrana! Please make the CI green and ping committers for further review.
Initial async micro-batch preload currently continues until both row and file limits are reached, which can retain excessive planned tasks for skewed snapshots. Stop when either limit is reached and cover both asymmetric cases. Generated-by: Codex
Format the Spark 3.5 and 4.0 regression tests using their configured source levels so CI Spotless checks pass. Generated-by: Codex
Keep the newly added Spark 4.2 runtime aligned with the existing Spark versions.\n\nGenerated-by: Codex
iamrajatrana
force-pushed
the
spark-fix-async-preload-limits
branch
from
September 6, 2026 18:33
60995ac to
5af974c
Compare
Author
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.
Async micro-batch initial preload currently combines its row and file safety limits with OR, so it keeps loading snapshots until both limits are reached. With skewed snapshots, this can substantially over-buffer files or rows during catch-up.
This changes the condition to AND so preload stops when either configured safety limit is reached across Spark 3.5, 4.0, 4.1, and 4.2. It also adds direct regression coverage for both asymmetric cases.
Fixes #17951
Tests:
TestAsyncSparkMicroBatchPlannerpasses for Spark 3.5, 4.0, and 4.1maincompile failure inRewriteDataFilesSparkActionandRewritePositionDeleteFilesSparkAction./gradlew -DsparkVersions=3.5,4.0,4.1,4.2 spotlessApplyAI Disclosure