Skip to content

Hive: Double check commit status for view commit conflicts#17087

Open
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/hive-view-commit-double-check
Open

Hive: Double check commit status for view commit conflicts#17087
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/hive-view-commit-double-check

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Closes #17074

Summary

  • HiveViewOperations.doCommit() threw CommitFailedException immediately on the HMS "modified" message, without checking whether the alter actually succeeded.
  • Mirrors HiveTableOperations.doCommit(), which already double-checks via checkCommitStatusStrict() before deciding the commit truly failed.
  • Related: merged fix in HiveTableOperations.doCommit() (PR Core, Hive: Double check commit status in case of commit conflict for NoLock #12637); sibling code at hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java.

Testing done

  • Added TestHiveViewCommits#modifiedConcurrentlyExceptionSucceedsWhenActuallyCommitted, which spies persistTable to actually persist then throw a "modified" exception, and asserts the commit completes and refresh() reflects the new metadata location.
  • ./gradlew :iceberg-hive-metastore:check — 13/13 tests passed in TestHiveViewCommits, 20/20 in TestHiveCommitLocks, 16/16 in TestHiveCommits; full module check build succeeded.
  • Not a revapi-scoped module (hive-metastore is not in the api/core/parquet/orc/common/data set), so revapi was skipped.

HiveViewOperations.doCommit() threw CommitFailedException immediately
on an HMS "modified" exception, without checking whether the commit
had actually succeeded. HiveTableOperations.doCommit() already double
checks this case via checkCommitStatusStrict() (PR apache#12637). This
mirrors that fix on the view commit path so a retried alter_table call
that actually succeeded is no longer reported as a failed commit.

Generated-by: Claude Code
@github-actions github-actions Bot added the hive label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hive: Double check commit status for view commit conflicts

1 participant