ConeyLiu commented on code in PR #6648:
URL: https://github.com/apache/iceberg/pull/6648#discussion_r1243332710
##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -339,26 +241,20 @@ protected void doCommit(TableMetadata base, TableMetadata
metadata) {
tbl.getParameters().remove(StatsSetupConst.COLUMN_STATS_ACCURATE);
}
- try {
- if (hiveLockHeartbeat.future.isCancelled()
- || hiveLockHeartbeat.encounteredException != null) {
- throw new CommitFailedException(
- "Failed to heartbeat for hive lock. %s",
- hiveLockHeartbeat.encounteredException.getMessage());
- }
+ lock.ensureActive();
+ try {
persistTable(tbl, updateHiveTable);
- if (hiveLockHeartbeat.future.isCancelled()
- || hiveLockHeartbeat.encounteredException != null) {
- throw new CommitStateUnknownException(
- "Failed to heartbeat for hive lock while "
- + "committing changes. This can lead to a concurrent commit
attempt be able to overwrite this commit. "
- + "Please check the commit history. If you are running into
this issue, try reducing "
- + "iceberg.hive.lock-heartbeat-interval-ms.",
- hiveLockHeartbeat.encounteredException);
- }
+ lock.ensureActive();
commitStatus = CommitStatus.SUCCESS;
+ } catch (LockException le) {
+ throw new CommitStateUnknownException(
Review Comment:
Hi @pvary, I think here we should set the `commitStatus` to `UNKNOWN` before
throwing the `CommitStateUnknownException`. Otherwise the `commitStatus` is
still `FAILURE` which could lead to the metadata being deleted in
`cleanupMetadataAndUnlock`.
--
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]