Visitar URL original
[SPARK-59919][SS][4.2] Fix OffsetSeqMetadataV2 missing shuffle partitions on rebinding by HeartSaVioR · Pull Request #59291 · apache/spark · GitHub
Skip to content

[SPARK-59919][SS][4.2] Fix OffsetSeqMetadataV2 missing shuffle partitions on rebinding - #59291

Open
HeartSaVioR wants to merge 1 commit into
apache:branch-4.2from
HeartSaVioR:backport-spark-59919-branch-4.2
Open

HeartSaVioR wants to merge 1 commit into
apache:branch-4.2from
HeartSaVioR:backport-spark-59919-branch-4.2

Conversation

@HeartSaVioR

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The changes in this PR:

  • Ensure that both V1 and V2 offset logs emit rebound SQL conf
  • Attempt to perform recovery of missing spark.sql.shuffle.partitions in V2 offset log by obtaining value from state metadata if possible

Why are the changes needed?

With current implementation the stateful shuffle partitions are not written out by OffsetSeqMetadataV2. If query is restarted and the session configured shuffle partitions change, the query will fail.

The exact error scenario and steps to reproduce are described in: https://issues.apache.org/jira/browse/SPARK-59919

The missing config key also leads to possible crash scenario as in #58929, which was addressed separately in that code path.

Does this PR introduce any user-facing change?

Yes, see the detail in https://issues.apache.org/jira/browse/SPARK-59919

How was this patch tested?

Tested with the included unit tests in this PR as well as with manual reproduction in spark

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GPT 5.6 Luna

…on rebinding

The changes in this PR:

- Ensure that both V1 and V2 offset logs emit rebound SQL conf
- Attempt to perform recovery of missing `spark.sql.shuffle.partitions` in V2 offset log by obtaining value from state metadata if possible

With current implementation the stateful shuffle partitions are not written out by OffsetSeqMetadataV2. If query is restarted and the session configured shuffle partitions change, the query will fail.

The exact error scenario and steps to reproduce are described in: https://issues.apache.org/jira/browse/SPARK-59919

The missing config key also leads to possible crash scenario as in apache#58929, which was addressed separately in that code path.

Yes, see the detail in https://issues.apache.org/jira/browse/SPARK-59919

Tested with the included unit tests in this PR as well as with manual reproduction in spark

Generated-by: GPT 5.6 Luna

Closes apache#59221 from ivasilyev1/v2-shuffle-partitions.

Authored-by: ivasilyev1 <25183110+ivasilyev1@users.noreply.github.com>
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
(cherry picked from commit 5d17442)
@HeartSaVioR HeartSaVioR changed the title [SPARK-59919][4.2][SS] Fix OffsetSeqMetadataV2 missing shuffle partitions on rebinding [SPARK-59919][SS][4.2] Fix OffsetSeqMetadataV2 missing shuffle partitions on rebinding Oct 8, 2026
@HeartSaVioR

Copy link
Copy Markdown
Contributor Author

Will merge once CI is green - this is a cherry-pick PR which resolves merge conflict.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants