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 2021/04/30 13:15:02 UTC

[GitHub] [iceberg] pvary commented on a change in pull request #2547: Hive: add table level JVM lock on HiveCatalog commit operation

pvary commented on a change in pull request #2547:
URL: https://github.com/apache/iceberg/pull/2547#discussion_r623867809



##########
File path: hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -96,6 +102,15 @@
       GC_ENABLED, "external.table.purge"
   );
 
+  private static Cache<String, ReentrantLock> commitLockCache;
+
+  private static synchronized void initTableLevelLockCache(long evictionTimeout) {
+    if (commitLockCache == null) {
+      commitLockCache = Caffeine.newBuilder()
+          .expireAfterAccess(evictionTimeout, TimeUnit.MILLISECONDS)

Review comment:
       How does `expireAfterAccess` work?
   I am worried about this sequence:
   - C1 commit comes, gets the JVM lock, and HMS lock
   - eviction timeout
   - C2 commit comes, gets a new JVM lock, and tries to lock
   - C1 finishes and unlocks the old JVM lock




-- 
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



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