Skip to content

[#41254] Spark 4 streaming: keep each leaf on its own checkpoint across restarts - #41256

Merged
Abacn merged 1 commit into
apache:masterfrom
tkaymak:spark4-streaming-leaf-order
Nov 19, 2026
Merged

Abacn merged 1 commit into
apache:masterfrom
tkaymak:spark4-streaming-leaf-order

Conversation

@tkaymak

@tkaymak tkaymak commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #41254, part of #36841.

The Spark 4 streaming runner starts one query per leaf and checkpoints leaf i under <checkpointDir>/<i>. The leaves were collected in a HashSet of TranslationResult, which has no equals or hashCode, so their order followed identity hash codes. For the same 8 leaf pipeline three JVM runs gave two different orders, so after a restart a leaf could resume from another leaf's checkpoint without an error. The leaves now keep translation order in a LinkedHashSet.

PipelineTranslatorTest.leavesFollowTranslationOrder translates 8 leaves and asserts the order. It failed before the change and passes on Spark 3 and 4. Locally gates, the streaming and both batch Structured Streaming ValidatesRunner suites and the full :runners:spark:4:test and :runners:spark:3:test pass. The trigger files run the Spark 4 and SparkStructuredStreaming ValidatesRunner PostCommits here, the batch suites also evaluate leaves in this order now.

Merge order: independent of #41307 and #41220. It conflicts with #40265 only in two adjacent lines of PipelineTranslator, I rebase whichever lands second.

@tkaymak

tkaymak commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

R: @Abacn

@github-actions github-actions Bot added runners spark size/s S: 10-49 lines changed labels Nov 12, 2026
@github-actions

Copy link
Copy Markdown
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 assign set of reviewers

@tkaymak tkaymak changed the title [#41254] Spark Structured Streaming runner: keep leaves in translation order [#41254] Spark 4 streaming: keep each leaf on its own checkpoint across restarts Nov 13, 2026
@tkaymak

tkaymak commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@Abacn, a friendly ping on this one, whenever you have time. It fixes #41254, where a leaf could resume from another leaf's checkpoint after a restart. #41426 is ready too, stateful ParDo with additional outputs. I also have a small fix for #41466 ready, a Spark 4 batch bug since 2.74.0, and I will open it on Monday unless you want it earlier.

@Abacn

Abacn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Thanks, this lgtm

@Abacn
Abacn merged commit f5118ac into apache:master Nov 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runners size/s S: 10-49 lines changed spark

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Spark 4 streaming runner can restore a leaf query from another leaf's checkpoint after a restart

2 participants