[SPARK-57232][SS][RTM][StreamingShuffle][Part7] Add additional e2e testing for streaming shuffle#57212
Closed
jerrypeng wants to merge 1 commit into
Closed
Conversation
jerrypeng
force-pushed
the
stack/streaming-shuffle-pr7-tests
branch
from
July 13, 2026 05:40
e6eeafd to
8b58c6e
Compare
Co-authored-by: Isaac
jerrypeng
force-pushed
the
stack/streaming-shuffle-pr7-tests
branch
from
July 13, 2026 06:23
0565370 to
20e4d3e
Compare
Contributor
|
Thanks! Merging to master/4.x. |
HeartSaVioR
pushed a commit
that referenced
this pull request
Jul 15, 2026
…sting for streaming shuffle ### What changes were proposed in this pull request? This is **part 7** of the multi-PR effort to add *streaming shuffle* to Spark -- a push-based shuffle used by Real-Time Mode (RTM) structured streaming, where writer tasks push records directly to reader tasks over the network instead of writing map output to disk for readers to pull. It adds the end-to-end test suite for the writer (part 4) and reader (part 5), together with a small operability improvement to the writer that the suite exercises. **End-to-end tests** -- `StreamingShuffleSuite`, a real-Netty integration suite that drives the full writer <-> reader path now that the writer and reader are merged. It covers, among other things: writer <-> reader data transfer, the credit-control / termination handshake, sequence-number validation (out-of-order / duplicate / missing detection), checksum verification, memory back-pressure, background-thread error propagation via `ErrorNotifier`, resource cleanup on task completion (including race conditions between background-thread failure and task-thread completion), and that a reader fails (rather than hangs) when a writer disconnects before terminating. **Writer oversized-row warnings** -- `StreamingShuffleWriter.write()` now logs a throttled warning when a serialized row is larger than the network block size, or larger than 25% of the total writer memory. Because a single row is never split across network buffers, an oversized row forces its own buffer past the configured block size and inflates the tracked memory budget; the warning tells operators to raise the block size or writer memory rather than silently overshoot. The throttling reuses the writer's existing `LogThrottler`, whose signature is adjusted to carry structured log context. **Test-only accessor** -- `TransportServer.channelFuture()` exposes the server's bound channel so the suite can assert the writer's server is up while writing and torn down after task completion. The full PR stack: - **Part 1** (SPARK-56674, *merged*) - streaming shuffle wire protocol (the four Netty message types). - **Part 2** (SPARK-56962, *merged*) - `StreamingShuffleOutputTracker` (driver-side writer-location coordination). - **Part 3** (SPARK-57141, *merged*) - shuffle-manager layer (`StreamingShuffleManager` + `MultiShuffleManager`). - **Part 3.5** (SPARK-57337, *merged*) - shared transport + error plumbing (`ErrorNotifier`, `TransportClient.send(ByteBuf)`, checksum config). - **Part 4** (SPARK-57229, *merged*) - `StreamingShuffleWriter` + server-side Netty handler (push path). - **Part 5** (SPARK-57230, *merged*) - `StreamingShuffleReader` + client-side Netty handler (pull path). - **Part 7** (*this PR*) - end-to-end `StreamingShuffleSuite` + writer oversized-row warnings. - Remaining parts wire the shuffle into the scheduler/block-manager lifecycle (activation) and add documentation. With parts 1 through 5 all merged, this PR is standalone against `master`. ### Why are the changes needed? The writer (part 4) and reader (part 5) were merged with unit-level coverage only. This PR adds the integration coverage that exercises them together over real Netty connections -- the push/pull data path, the credit-control and termination handshakes, error propagation, and resource cleanup -- so regressions in the end-to-end protocol are caught. The oversized-row warnings give operators actionable feedback when row sizes defeat the writer's buffering, which is otherwise silent. ### Does this PR introduce _any_ user-facing change? No. The only production-code change is two additional (throttled) log warnings on the streaming shuffle write path, which is reached only when the opt-in streaming shuffle manager is configured via `spark.shuffle.manager`. The default sort shuffle is unaffected. ### How was this patch tested? This PR is itself the test suite. `StreamingShuffleSuite` is an end-to-end integration suite (real Netty writer + reader) covering the full push/pull path, the credit-control / termination handshake, sequence-number and checksum validation, memory back-pressure, error propagation, resource cleanup, and the oversized-row warnings added here. Run with: ``` build/sbt "core/testOnly org.apache.spark.shuffle.streaming.StreamingShuffleSuite" ``` ### Was this patch authored or co-authored using generative AI tooling? Co-authored with Claude Code (Claude Opus 4.8) Closes #57212 from jerrypeng/stack/streaming-shuffle-pr7-tests. Authored-by: Boyang Jerry Peng <jerry.peng@databricks.com> Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com> (cherry picked from commit b22a865) Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
Contributor
Contributor
Author
|
thanks @HeartSaVioR ! |
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 is part 7 of the multi-PR effort to add streaming shuffle to Spark -- a push-based shuffle used by Real-Time Mode (RTM) structured streaming, where writer tasks push records directly to reader tasks over the network instead of writing map output to disk for readers to pull. It adds the end-to-end test suite for the writer (part 4) and reader (part 5), together with a small operability improvement to the writer that the suite exercises.
End-to-end tests --
StreamingShuffleSuite, a real-Netty integration suite that drives the full writer <-> reader path now that the writer and reader are merged. It covers, among other things: writer <-> reader data transfer, the credit-control / termination handshake, sequence-number validation (out-of-order / duplicate / missing detection), checksum verification, memory back-pressure, background-thread error propagation viaErrorNotifier, resource cleanup on task completion (including race conditions between background-thread failure and task-thread completion), and that a reader fails (rather than hangs) when a writer disconnects before terminating.Writer oversized-row warnings --
StreamingShuffleWriter.write()now logs a throttled warning when a serialized row is larger than the network block size, or larger than 25% of the total writer memory. Because a single row is never split across network buffers, an oversized row forces its own buffer past the configured block size and inflates the tracked memory budget; the warning tells operators to raise the block size or writer memory rather than silently overshoot. The throttling reuses the writer's existingLogThrottler, whose signature is adjusted to carry structured log context.Test-only accessor --
TransportServer.channelFuture()exposes the server's bound channel so the suite can assert the writer's server is up while writing and torn down after task completion.The full PR stack:
StreamingShuffleOutputTracker(driver-side writer-location coordination).StreamingShuffleManager+MultiShuffleManager).ErrorNotifier,TransportClient.send(ByteBuf), checksum config).StreamingShuffleWriter+ server-side Netty handler (push path).StreamingShuffleReader+ client-side Netty handler (pull path).StreamingShuffleSuite+ writer oversized-row warnings.With parts 1 through 5 all merged, this PR is standalone against
master.Why are the changes needed?
The writer (part 4) and reader (part 5) were merged with unit-level coverage only. This PR adds the integration coverage that exercises them together over real Netty connections -- the push/pull data path, the credit-control and termination handshakes, error propagation, and resource cleanup -- so regressions in the end-to-end protocol are caught. The oversized-row warnings give operators actionable feedback when row sizes defeat the writer's buffering, which is otherwise silent.
Does this PR introduce any user-facing change?
No. The only production-code change is two additional (throttled) log warnings on the streaming shuffle write path, which is reached only when the opt-in streaming shuffle manager is configured via
spark.shuffle.manager. The default sort shuffle is unaffected.How was this patch tested?
This PR is itself the test suite.
StreamingShuffleSuiteis an end-to-end integration suite (real Netty writer + reader) covering the full push/pull path, the credit-control / termination handshake, sequence-number and checksum validation, memory back-pressure, error propagation, resource cleanup, and the oversized-row warnings added here. Run with:Was this patch authored or co-authored using generative AI tooling?
Co-authored with Claude Code (Claude Opus 4.8)