Skip to content

fix(table): validate snapshot timestamp drift on add snapshot#3062

Open
mrutunjay-kinagi wants to merge 2 commits intoapache:mainfrom
mrutunjay-kinagi:fix-2938-snapshot-timestamp
Open

fix(table): validate snapshot timestamp drift on add snapshot#3062
mrutunjay-kinagi wants to merge 2 commits intoapache:mainfrom
mrutunjay-kinagi:fix-2938-snapshot-timestamp

Conversation

@mrutunjay-kinagi
Copy link

Rationale for this change

Align snapshot timestamp validation with other Iceberg implementations by rejecting snapshots that drift backwards by more than one minute.

The new guard in AddSnapshotUpdate checks:

  • snapshot timestamp vs latest snapshot_log entry
  • snapshot timestamp vs table last_updated_ms

Both checks allow up to 60 seconds of clock skew tolerance.

Are these changes tested?

Yes.

  • Added test_update_metadata_add_snapshot_rejects_old_timestamp_vs_snapshot_log.
  • Added test_update_metadata_add_snapshot_rejects_old_timestamp_vs_last_updated.
  • Verified with targeted pytest run.

Are there any user-facing changes?

No API changes.

  • Invalid commit metadata now fails fast with explicit ValueError when timestamp drift exceeds tolerance.

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