Skip to content

[SPARK-58881][CORE] Ignore non-numeric checkpoint part files - #58535

Open
charliec05 wants to merge 1 commit into
apache:masterfrom
charliec05:codex/spark-58881-ignore-nonnumeric-checkpoint
Open

[SPARK-58881][CORE] Ignore non-numeric checkpoint part files#58535
charliec05 wants to merge 1 commit into
apache:masterfrom
charliec05:codex/spark-58881-ignore-nonnumeric-checkpoint

Conversation

@charliec05

Copy link
Copy Markdown

What changes were proposed in this pull request?

Tighten the checkpoint directory scan so it accepts only file names consisting of part- followed by one or more ASCII digits. The existing numeric ordering and contiguous partition validation remain unchanged.

Add a regression test that creates a valid checkpoint, adds part-00000.bak, part-backup, and part- files, and verifies that the checkpoint can still be recovered.

Why are the changes needed?

ReliableCheckpointRDD.getPartitions currently accepts every name starting with part- and then parses the suffix as an integer. Leftover or externally created files such as part-00000.bak therefore cause an unhelpful NumberFormatException and make an otherwise valid checkpoint unreadable.

Spark's own checkpoint files always use a numeric suffix. Ignoring non-numeric names avoids that failure without changing validation for malformed numeric checkpoint layouts.

Does this PR introduce any user-facing change?

Yes. Reading a checkpoint directory now ignores non-numeric part-* files. Numeric checkpoint files continue to be validated for the expected names and contiguous partition sequence.

How was this patch tested?

Added a regression test and ran:

build/sbt "core/Test/testOnly org.apache.spark.CheckpointStorageSuite"

All 9 tests passed. Also ran dev/lint-scala; Scalastyle and Scalafmt passed.

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

Generated-by: OpenAI Codex (GPT-5)

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