chihsuan commented on code in PR #11216:
URL: https://github.com/apache/ozone/pull/11216#discussion_r3951368055


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java:
##########
@@ -333,6 +333,11 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
         OMFileRequest.addKeyTableCacheEntries(omMetadataManager, volumeName,
             bucketName, bucketInfo.getBucketLayout(),
             null, missingParentInfos, trxnLogIndex);
+
+        // Parent directory creation holds the bucket write lock; key path 
locking leaves
+        // numMissingParents at 0.
+        omMetadataManager.getBucketTable().addCacheEntry(
+            omMetadataManager.getBucketKey(volumeName, bucketName), 
bucketInfo, trxnLogIndex);

Review Comment:
   Same as above.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3ExpiredMultipartUploadsAbortRequest.java:
##########
@@ -106,18 +108,44 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
     Result result = null;
     Map<OmBucketInfo, List<OmMultipartAbortInfo>>
         abortedMultipartUploads = new HashMap<>();
+    // One accumulated copy per bucket, so a bucket listed more than once 
keeps a single entry.
+    Map<Pair<String, String>, OmBucketInfo> bucketInfoMap = new HashMap<>();
+
+    OMMetadataManager omMetadataManager = ozoneManager.getMetadataManager();
+    List<String[]> bucketLockKeys = submittedExpiredMPUsPerBucket.stream()
+        .map(mpuByBucket -> Pair.of(mpuByBucket.getVolumeName(), 
mpuByBucket.getBucketName()))
+        .distinct()
+        .map(volBucketPair -> new String[]{volBucketPair.getLeft(), 
volBucketPair.getRight()})
+        .collect(Collectors.toList());
+    boolean acquiredLocks = false;

Review Comment:
   `acquireWriteLocks` already sorts locks by stripe index via 
`Striped.bulkGet`.



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

Reply via email to