pvary commented on code in PR #18692:
URL: https://github.com/apache/iceberg/pull/18692#discussion_r4549051406
##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveViewOperations.java:
##########
@@ -228,18 +218,40 @@ public void doCommit(ViewMetadata base, ViewMetadata
metadata) {
e);
}
- LOG.error(
- "Cannot tell if commit to {}.{} succeeded, attempting to reconnect
and check.",
- database,
- viewName,
- e);
commitStatus = BaseMetastoreOperations.CommitStatus.UNKNOWN;
- commitStatus =
- checkCommitStatus(
- viewName,
- newMetadataLocation,
- metadata.properties(),
- () -> checkCurrentMetadataLocation(newMetadataLocation));
+ if (e.getMessage() != null
+ && e.getMessage()
+ .contains(
+ "The table has been modified. The parameter value for key
'"
+ + BaseMetastoreTableOperations.METADATA_LOCATION_PROP
+ + "' is")) {
+ // The HMS client may retry an alter that already succeeded, after a
network issue for
+ // example, and hit this exception, so check whether the commit was
applied. No pending
+ // request can succeed after this exception, so the strict status
check is safe.
+ commitStatus =
+ checkCommitStatusStrict(
+ viewName,
+ newMetadataLocation,
+ metadata.properties(),
+ () -> checkCurrentMetadataLocation(newMetadataLocation));
+ if (commitStatus == BaseMetastoreOperations.CommitStatus.FAILURE) {
Review Comment:
nit: `CommitStatus.FAILURE` - don't need `BaseMetastoreOperations`
--
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]