hcrosse opened a new pull request, #2100: URL: https://github.com/apache/iceberg-go/pull/2100
Related to #1079 ## What Failed table requirements, such as a branch moving after the table was loaded, now wrap `table.ErrCommitFailed` without changing their error messages. Two failures stay terminal because a refresh can't fix them: - targeting a tag as a transaction branch. - metadata with no last assigned partition id. ## Why Glue, SQL, and Hadoop validate commit requirements on the client and returned plain validation errors. REST reports these conflicts as HTTP 409, which already maps to `ErrCommitFailed`. Two writers appending to one table could retry through REST, but `doCommit` stopped at the first requirement conflict on Glue, SQL, or Hadoop regardless of `commit.retry.num-retries`. Callers also couldn't detect the conflict with `errors.Is`. Java's `UpdateRequirement` (`CommitFailedException`), PyIceberg (`CommitFailedException`), and iceberg-rust (`ErrorKind::CatalogCommitConflicts`, retryable) all report these failures as retryable commit conflicts. This change matches them. ## Compatibility `errors.Is(err, table.ErrCommitFailed)` now returns true for these failures. With `commit.retry.num-retries` above 0, `doCommit` refreshes and retries. Branch requirements are rebased onto the refreshed head, allowing an append that raced a peer to commit on retry. Pinned ref requirements are not rebased and fail on the first refresh that detects a mismatch. Other requirements, such as a stale schema id, still fail when the retry budget is spent. Requirement checks run before the catalog writes anything, so orphaned manifest lists can be safely cleaned up after a retry. ## Verification - Unit tests cover each requirement's failure and the two terminal failures. - A SQL catalog test appends from a stale table handle after a peer commit. With retries enabled, the stored values are exactly `seed`, `peer`, and `stale`. With retries disabled, the caller gets `ErrCommitFailed` and only `seed` and `peer` remain. Both cases fail without the change. -- 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]
