delta icon indicating copy to clipboard operation
delta copied to clipboard

[kernel] Improve error messages in SnapshotManager.getLogSegmentFor…

Open harishkesavarao opened this issue 2 months ago • 6 comments

…Version

Which Delta project/connector is this regarding?

  • [ ] Spark
  • [ ] Standalone
  • [ ] Flink
  • [x] Kernel
  • [ ] Other (fill in here)

Description

Resolves https://github.com/delta-io/delta/issues/2283

How was this patch tested?

Unit tests in SnapshotManagerSuite.scala.

[info] Run completed in 1 minute, 46 seconds. [info] Total number of tests run: 37 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 37, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed.

Does this PR introduce any user-facing changes?

Yes, the PR provides better error logging for users in the SnapshotManager.getLogSegmentforVersion method.

Error name: Missing Delta File at Checkpoint Version (Line 422): Before: "Missing delta file for version %s" After: "Missing delta file for version %d. Every checkpoint must have a corresponding delta file at the same version."

Error name: Missing Delta File Version (Lines 452-456): Before: "Cannot compute snapshot. Missing delta file version %d." After: "Cannot compute snapshot. Missing delta file version %d. Expected delta files to start from version %d after checkpoint version %d, but found delta file at version %d."

Corrupted Checkpoint Files (Lines 490-500): Before: "Seems like the checkpoint is corrupted. Failed in getting the file information for:\n%s\namong\n%s" After: "Checkpoint at version %d appears to be corrupted. Expected to find %d checkpoint files but only found %d. Missing files:\n%s\nAvailable checkpoint files:\n%s"

Non-Contiguous Delta Versions (Lines 154-155): Before: "Missing delta files: versions are not contiguous: (%s)" After: "Missing delta files: versions are not contiguous. Expected version %d after version %d, but found version %d. All versions: %s"

No Complete Checkpoint and No Delta Files (Line 410): Before: "No complete checkpoint found and no delta files found" After: "No complete checkpoint found and no delta files found. This may indicate a corrupted or incomplete Delta table."

harishkesavarao avatar Oct 12 '25 17:10 harishkesavarao

@allisonport-db can I get a review on the PR please?

harishkesavarao avatar Oct 19 '25 15:10 harishkesavarao

Hey, can you look into why the CI tests are failing?

allisonport-db avatar Oct 20 '25 21:10 allisonport-db

Hey, can you look into why the CI tests are failing?

Sure thing, sorry for the delay. Will look into it.

harishkesavarao avatar Nov 02 '25 09:11 harishkesavarao

Hey, can you look into why the CI tests are failing?

Sure thing, sorry for the delay. Will look into it.

@allisonport-db, I believe the CI tests are looking good now. Can you please review? Thanks again.

harishkesavarao avatar Nov 02 '25 14:11 harishkesavarao

@allisonport-db, just following up on the PR to see if you needed anything else from me.

harishkesavarao avatar Nov 23 '25 07:11 harishkesavarao

@harishkesavarao can you fix the failing tests?

allisonport-db avatar Dec 02 '25 18:12 allisonport-db

@allisonport-db thank you for letting me know about the tests and for approving the PR. The tests hadn't reflected the recent code revert I did. The tests are passing now. Thanks again!

harishkesavarao avatar Dec 03 '25 03:12 harishkesavarao

@allisonport-db just wanted to check in again to see if the PR looks good to merge. Thank you!

harishkesavarao avatar Dec 19 '25 15:12 harishkesavarao