Anurag-S1ngh opened a new pull request, #4333: URL: https://github.com/apache/iceberg-python/pull/4333
# Rationale for this change Some REST catalogs expose only the current snapshot and keep table history elsewhere, Nessie being the main example. `CommitWindow.resolve` raised `ValidationException: Cannot find starting snapshot <id>` whenever the starting snapshot was missing after a refresh, so since the retry added in #3320 no commit loser could ever retry on those catalogs, not even a plain append. The window now records that the starting snapshot is missing instead of raising: - Operations that need no conflict validation, such as appends, retry as they do anywhere else. `_refresh_for_retry` already rebuilds on the refreshed head, which is also what Java's `SnapshotProducer` does. - Operations that do validate, such as overwrites and deletes, cannot run the check without the history. They now raise `CommitFailedException` with a message saying the starting snapshot is not exposed, which is the pre-0.12 behavior and tells a lost race apart from a data conflict. They never continue without validation. # Are these changes tested? Yes. New tests in `tests/table/test_commit_retry.py` hide the starting snapshot from the refreshed metadata to emulate a catalog without history: - `test_append_retry_without_starting_snapshot` races two appends and asserts the loser retries and both land. - `test_delete_retry_without_starting_snapshot_raises_commit_failed` asserts a delete raises `CommitFailedException` instead of `ValidationException`. - `test_validate_concurrency_marks_missing_starting_snapshot` covers the window flags directly. All three fail on main and pass with the change. Full unit suite: `4570 passed, 5 skipped`. `prek run -a` passes. # Are there any user-facing changes? Yes. On catalogs that only expose the current snapshot, retried appends now succeed instead of raising `ValidationException`. Retried overwrites and deletes raise `CommitFailedException` again, as they did before 0.12, with a message that names the missing starting snapshot. Closes #4327 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
