Skip to content

fix(metadata): validate snapshot bounds at catalog and build boundaries - #1206

Draft
manuzhang wants to merge 4 commits into
apache:mainfrom
manuzhang:fix/validate-snapshot-metadata-boundaries
Draft

manuzhang wants to merge 4 commits into
apache:mainfrom
manuzhang:fix/validate-snapshot-metadata-boundaries

Conversation

@manuzhang

@manuzhang manuzhang commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Why

If a retained snapshot has a sequence number above the table's last-sequence-number, a subsequent commit can reuse an already assigned sequence number. Iceberg Java rejects that inconsistency when it constructs table metadata; C++ should also reject it before using or persisting the metadata.

What

  • Check the retained-snapshot sequence bound and the v1 zero-sequence rule at metadata file, REST, and builder boundaries, outside JSON serde.
  • Preserve Java's existing add-time exemption for parentless snapshots and leave row-lineage rules unchanged.
  • If a successful REST commit returns inconsistent metadata, log the validation failure and return CommitStateUnknown so the client preserves staged files and does not replay the POST.

Validation

Pre-commit and git diff --check passed. The table_test, arrow_test, and rest_catalog_test suites passed on macOS.

manuzhang and others added 3 commits December 3, 2026 10:50
Keep the retained-snapshot sequence bound without changing how the builder handles parentless snapshots or adding a retained row ID check. Preserve the safe REST response handling and fix the regression tests to use the Catalog interface.

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Treat unreadable responses after commit, immediate create, and register as unknown so callers can preserve staged files and check whether the write took effect.

Co-authored-by: Codex <codex@openai.com>

This branch has not been deployed

No deployments
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