You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/05/23 08:38:21 UTC

[GitHub] [hive] pvary commented on a diff in pull request #3308: HIVE-26252: Missing locks in case of MERGE with multiple branches

pvary commented on code in PR #3308:
URL: https://github.com/apache/hive/pull/3308#discussion_r879171937


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java:
##########
@@ -168,8 +169,9 @@ private void setPart(LockComponent comp, PartTrie parts) {
       if (existing == null) {
         // No existing lock for this partition.
         parts.put(comp.getPartitionname(), comp);
-      }  else if (lockTypeComparator.compare(comp.getType(), existing.getType()) > 0) {
-        // We only need to promote if comp.type is > existing.type.
+      } else if (lockTypeComparator.compare(comp.getType(), existing.getType()) > 0
+          || comp.getType() == existing.getType() && existing.getOperationType() == DataOperationType.INSERT) {

Review Comment:
   Why does this help?
   I do not get why would it help to have 2 INSERT locks.
   Could you help me elaborate a little bit?
   Thanks,
   Peter



-- 
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-unsubscribe@hive.apache.org

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


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