Conversation
…issing createMetadata()'s base-reuse path only checks that the base metadata JSON itself exists before reading it via createMetadataWithBase(). That JSON's current-snapshot manifest list, however, can be pruned by unrelated, later retention cleanup even while the base file stays present and otherwise looks healthy. IcebergManifestList (an ObjectsFile) wraps the resulting FileNotFoundException in a plain, unchecked RuntimeException, so it slips past the catch (IOException) at the bottom of createMetadata and crashes commit recovery every time it retries, forever, since the missing file never comes back. Catch that specific failure around createMetadataWithBase and fall back to createMetadataWithoutBase, the same call already used when the base file is absent entirely. This loses that snapshot's Iceberg-side history/lineage, the same tradeoff already accepted in the base-missing case, but lets the table keep committing instead of getting stuck. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…Files expireAllBefore() walked every metadata JSON strictly before the snapshot being committed and deleted the manifests/manifest-lists each one referenced, without regard for the more conservative retention floor deleteApplicableMetadataFiles() uses to decide which JSON files to keep (previous-versions-max). This meant a metadata version deliberately retained as a JSON file could have the manifest list its own current snapshot depends on deleted in the very same call, producing a dangling reference. When metadata.iceberg.delete-after-commit.enabled is false (retain every version forever), the same unconditional loop deleted manifests that were never supposed to be touched at all. Extracts the retention-floor computation into one shared helper used by both cleanup steps, so they can never disagree about what's still retained. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Tests