Skip to content

[Bug]: Spark 4 streaming runner drops output when one shuffle feeds two stateful transforms #41297

Closed

Description

@tkaymak

What happened?

In streaming mode the Spark 4 Structured Streaming runner can silently drop the output of a stateful transform. When one shuffle feeds two stateful transforms, for example a Reshuffle followed by two GroupByKeys, 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 event time timers never fire and its windows never close.

Reproduced on master: Create.of(1, 2, 3), WithKeys.of("k"), Reshuffle.of(), two GroupByKeys with a sum each, Flatten, PAssert expecting both sums. Only the first sum arrives, 2 of 2 runs. It also reproduces in plain Spark 4.0.2 with two transformWithState operators behind one reused exchange: the second fires 0 timers with spark.sql.exchange.reuse=true and all of them with false.

This is SPARK-60862, fixed in Spark 4.4.0 only. No released Spark version has the fix and the runner pins 4.0.2. Until the runner moves to a fixed Spark, it should disable exchange reuse for its streaming queries.

Part of #36841.

Issue Priority

Priority: 1 (data loss / total loss of function)

Issue Components

  • Component: Spark Runner

Activity

  1. tkaymak commented on Nov 13, 2026

    @tkaymak
    ContributorAuthor

    .take-issue

  2. added a commit that references this issue on Nov 13, 2026
  3. added this to the 2.79.0 Release milestone on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions