Hive: Double check commit status for view commit conflicts
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 132
Description
**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.
Contributor guide
Research direction
Start in hive-metastore/src/main/java/org/apache/iceberg/hive/HiveViewOperations.java at the catch block around line 211, then compare it with HiveTableOperations.doCommit() and its checkCommitStatusStrict() handling from PR #12637. Verify the view commit checks whether the metadata location is current after an HMS modified response, so an already-applied alter succeeds while a genuinely failed commit still raises CommitFailedException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100