Skip to content

[SPARK-56461][SS] Disable File Checksum for Checkpoint Format Version 1#55328

Open
zifeif2 wants to merge 4 commits intoapache:masterfrom
zifeif2:disable-cehcksum-v1
Open

[SPARK-56461][SS] Disable File Checksum for Checkpoint Format Version 1#55328
zifeif2 wants to merge 4 commits intoapache:masterfrom
zifeif2:disable-cehcksum-v1

Conversation

@zifeif2
Copy link
Copy Markdown
Contributor

@zifeif2 zifeif2 commented Apr 13, 2026

What changes were proposed in this pull request?

Modified checkpointFileChecksumEnabled to require both the SQL conf setting AND checkpoint format version >= 2 (via enableStateStoreCheckpointIds):

val checkpointFileChecksumEnabled: Boolean =
  sqlConf.checkpointFileChecksumEnabled && sqlConf.enableStateStoreCheckpointIds

This effectively disables file checksum when checkpoint version is v1, regardless of the conf setting.

Also update a list of tests that were testing checksum behavior on ckpt version 1 to version 2

Also fixed helper function testWithStateStoreCheckpointIdsAndChangelogEnabled which was not running any test because previous implementation pass enableStateStoreCheckpointIds => testBody(enableStateStoreCheckpointIds) to underlying testWithChangelogCheckpointingDisabled which expects a function without any parameters.

Why are the changes needed?

When using checkpoint format version 1 (STATE_STORE_CHECKPOINT_FORMAT_VERSION = 1), file checksum verification (spark.sql.streaming.checkpoint.fileChecksum.enabled) can query failure during query restart. This is because v1 does not use unique file names per batch attempt — if a batch fails and is retried, the same file name is reused, which can cause the checksum from a previous attempt to mismatch with the file content from the new attempt.

Does this PR introduce any user-facing change?

No

How was this patch tested?

See added unit tests

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

yes

@zifeif2 zifeif2 changed the title [SS] Disable File Checksum for Checkpoint Format Version 1 [SPARK-56461][SS] Disable File Checksum for Checkpoint Format Version 1 Apr 13, 2026
s"$enableStateStoreCheckpointIds"
testWithChangelogCheckpointingDisabled(newTestName, testTags: _*) {
enableStateStoreCheckpointIds => testBody(enableStateStoreCheckpointIds)
val v2Confs = if (enableStateStoreCheckpointIds) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the bug here - previously the tests weren't running

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.

1 participant