Repository navigation
[#41297] Spark 4 streaming: fix lost output when one shuffle feeds two stateful transforms - #41307
Merged
Merged
Conversation
Contributor
Author
|
R: @Abacn |
Contributor
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
This was referenced Nov 13, 2026
Abacn
approved these changes
Nov 13, 2026
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.
Fixes #41297, part of #36841.
In streaming, when one shuffle feeds two stateful transforms, for example a
Reshufflefollowed by twoGroupByKeys, Spark reuses the shuffle for the second consumer. Spark 4.0.2 then gives the stateful operator above the reused shuffle no input watermark, so its timers never fire and its output is lost. This is SPARK-60862, fixed only in Spark 4.4.0, which is not released yet.The runner now sets
spark.sql.exchange.reuseto false on the session before it starts its streaming queries. It is not restored afterwards, since pipelines can share a session and a restore could reach a query that is still starting. Reuse off only costs recomputation. The TODO points at #41297 to drop it once the runner uses Spark 4.4.0 or later.PAssertStreamingTest.testReshuffleFeedingTwoGroupByKeysruns aReshuffleinto twoGroupByKeys. It fails on master (one output missing) and passes with this change.Merge order: independent of #41256 and #41220, suggested first since it fixes silent data loss on master. All three bump the Spark 4 trigger file, I rebase the later ones.