[SPARK-59403][CORE] Fix remote fetch of empty deserialized RDD blocks - #58697
Open
leixm wants to merge 1 commit into
Open
[SPARK-59403][CORE] Fix remote fetch of empty deserialized RDD blocks#58697leixm wants to merge 1 commit into
leixm wants to merge 1 commit into
Conversation
A deserialized in-memory block's reported memory size is an estimated JVM object size, not the size of its serialized response. Its serialized response may therefore be empty. Track the location that owns the status returned by the master. Accept an empty response only when it comes from that exact location and the status reports a deserialized in-memory block. Continue treating empty responses from the external shuffle service or any other location as fetch failures, so the existing retry and failure detection behavior is preserved. Add regression coverage for an allowed empty executor response, a rejected external-shuffle-service response, and a response whose location does not match the status-owning location. Generated-by: OpenAI Codex
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 changes were proposed in this pull request?
This PR associates the representative
BlockStatusreturned byBlockLocationsAndStatuswith theBlockManagerIdthat owns it.BlockManagernow accepts an empty remote response only when it is fetchedfrom that exact location and the location reports a deserialized in-memory
block. Empty responses from external shuffle services or other locations
continue to be treated as fetch failures.
The PR also adds regression tests for:
Why are the changes needed?
For deserialized in-memory blocks,
memSizeis an estimated size of JVMobjects, not the size of the serialized data sent over the network. Therefore,
an empty iterator can have a positive
memSizewhile its serialized responseis empty.
The previous check interpreted every empty response for a positive block size
as a failed fetch. A simple exception based only on the representative status
would be unsafe because the status can belong to a different replica. This PR
keeps the corruption and stale-location protection by applying the exception
only to the status-owning executor.
Does this PR introduce any user-facing change?
Yes. Remote reads of an affected empty deserialized RDD cache block can now
succeed instead of being incorrectly reported as unavailable. There are no
public API or configuration changes.
How was this patch tested?
build/sbt 'core/testOnly org.apache.spark.storage.BlockManagerSuiteThe suite completed successfully with 133 tests passed.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex 5.6 Terra.