iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Hive: Double check commit status for view commit conflicts

Open thswlsqls opened this issue 4 months ago • 1 comments

Apache Iceberg version main @ 49b89a8c5

Query engine N/A (catalog-level, engine-agnostic)

Please describe the bug HiveViewOperations.doCommit() (hive-metastore/src/main/java/org/apache/iceberg/hive/HiveViewOperations.java, catch block around line 211) throws CommitFailedException immediately on the HMS "modified" message, without checking whether the alter actually succeeded (e.g. a client retry after a network blip on an already-applied call). This can report a spurious failure for a commit that went through.

HiveTableOperations.doCommit() (same package) already handles this correctly: it double-checks via checkCommitStatusStrict() before deciding the commit truly failed (PR #12637, merged 2025-04-02). The view path never got the same fix, so table and view commits behave inconsistently here.

Steps to reproduce

  1. Commit a change to a view backed by HiveViewOperations.
  2. The HMS alter_table call succeeds, but the client observes/retries it, raising "The table has been modified...".
  3. Expected: since the metadata location is current, the commit should succeed (as tables do).
  4. Actual: doCommit() throws CommitFailedException immediately.

thswlsqls avatar Jul 03 '26 22:07 thswlsqls

#17087 by @thswlsqls was moved to draft in July, closed by the stale bot in August without a review, and its branch was deleted in September. @thswlsqls, if you'd like to continue it, I'll step aside; otherwise I'd like to pick this up and credit your work. The plan is to mirror HiveTableOperations.doCommit from #12637, so the view commit runs a strict commit status check on the HMS "modified" error and only fails if the new metadata location is not current.

binarybrain-009 avatar Oct 29 '26 14:10 binarybrain-009