Skip to content

Oleksandr.nitavskyi/iceberg metadata base fallback - #9943

Draft
JTaky wants to merge 2 commits into
apache:masterfrom
JTaky:oleksandr.nitavskyi/iceberg-metadata-base-fallback
Draft

JTaky wants to merge 2 commits into
apache:masterfrom
JTaky:oleksandr.nitavskyi/iceberg-metadata-base-fallback

Conversation

@JTaky

@JTaky JTaky commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Purpose

Tests

JTaky and others added 2 commits September 17, 2026 17:42
…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>
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