You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/10/04 17:41:16 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #513: Fix concurrency issue in HiveTableOperations when Table is reused

rdblue commented on a change in pull request #513: Fix concurrency issue in HiveTableOperations when Table is reused
URL: https://github.com/apache/incubator-iceberg/pull/513#discussion_r331612798
 
 

 ##########
 File path: hive/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
 ##########
 @@ -129,6 +129,11 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
     Optional<Long> lockId = Optional.empty();
     try {
       lockId = Optional.of(acquireLock());
+
+      if (base != current()) {
+        throw new CommitFailedException("Cannot commit: stale table metadata for %s.%s", database, tableName);
 
 Review comment:
   This works to ensure that `base.location()` is the same as `currentMetadataLocation()`, but I think that line 155/160 should use `base.location()`. That way the check is for `base` and the current location in the Hive Metastore and doesn't rely on additional state in the `TableOperations` object and a secondary check here. This is a good check to fail fast, but the real check should be the base location and the current HMS location.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org