Hive: Double check commit status for view commit conflicts
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
- Commit a change to a view backed by
HiveViewOperations. - The HMS
alter_tablecall succeeds, but the client observes/retries it, raising "The table has been modified...". - Expected: since the metadata location is current, the commit should succeed (as tables do).
- Actual:
doCommit()throwsCommitFailedExceptionimmediately.
#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.