deniskuzZ commented on code in PR #5687:
URL: https://github.com/apache/hive/pull/5687#discussion_r1986367661


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -409,8 +411,12 @@ public void 
preAlterTable(org.apache.hadoop.hive.metastore.api.Table hmsTable, E
           context.getProperties().get(OLD_TABLE_NAME)).toString());
     }
     if (commitLock == null) {
-      commitLock = new MetastoreLock(conf, new CachedClientPool(conf, 
Maps.fromProperties(catalogProperties)),
-          catalogProperties.getProperty(Catalogs.NAME), hmsTable.getDbName(), 
hmsTable.getTableName());
+      if (HiveTableOperations.hiveLockEnabled(null, conf)) {

Review Comment:
   I think, HiveIcebergMetaHook should always use MetastoreLock.
   what if Hive conf is set to `NO_LOCK`, but the user has overridden it on the 
table level to `METASTORE_LOCK`? That would break the transaction isolation.
   `METASTORE_LOCK` is a stronger one that checks if `metadataLocation` hasn't 
changed.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to