sumitagrawl commented on code in PR #4021:
URL: https://github.com/apache/ozone/pull/4021#discussion_r1047965907


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMDirectoriesPurgeRequestWithFSO.java:
##########
@@ -75,12 +75,13 @@ public OMClientResponse validateAndUpdateCache(OzoneManager 
ozoneManager,
                 volumeName, bucketName);
             lockSet.add(volBucketPair);
           }
-          OmBucketInfo omBucketInfo = getBucketInfo(omMetadataManager,
-              volumeName, bucketName);
+          updateBucketInfo(volBucketInfoMap, omMetadataManager, path,
+              volumeName, bucketName, volBucketPair);
+          OmBucketInfo omBucketInfo = volBucketInfoMap.get(volBucketPair);
           // bucketInfo can be null in case of delete volume or bucket
+          // or key does not belong to bucket as bucket is recreated
           if (null != omBucketInfo) {
             omBucketInfo.incrUsedNamespace(-1L);
-            volBucketInfoMap.putIfAbsent(volBucketPair, omBucketInfo);
           }
         }

Review Comment:
   I have removed it, as other element can have valid bucketId and volumeId, so 
added a check always. @neils-dev Thanks.



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMDirectoriesPurgeRequestAndResponse.java:
##########
@@ -52,6 +53,13 @@ public class TestOMDirectoriesPurgeRequestAndResponse 
extends TestOMKeyRequest {
    * Creates volume, bucket and key entries and adds to OM DB and then
    * deletes these keys to move them to deletedKeys table.
    */
+  @Before
+  public void cleanup() throws Exception {
+    String bucketKey = omMetadataManager.getBucketKey(volumeName,
+        bucketName);
+    omMetadataManager.getBucketTable().delete(bucketKey);
+  }
+  

Review Comment:
   updated



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