bharatviswa504 commented on a change in pull request #1559: HDDS-1737. Add 
Volume check in KeyManager and File Operations.
URL: https://github.com/apache/hadoop/pull/1559#discussion_r333148592
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRenameRequest.java
 ##########
 @@ -123,10 +125,15 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
       acquiredLock = omMetadataManager.getLock().acquireLock(BUCKET_LOCK,
           volumeName, bucketName);
 
-      // Not doing bucket/volume checks here. In this way we can avoid db
-      // checks for them.
-      // TODO: Once we have volume/bucket full cache, we can add
-      // them back, as these checks will be inexpensive at that time.
+      // Check bucket/volume exist.
+      String volumeKey = omMetadataManager.getVolumeKey(volumeName);
+      String bucketKey = omMetadataManager.getBucketKey(volumeName, 
bucketName);
+      if (!omMetadataManager.getBucketTable().isExist(bucketKey)) {
 
 Review comment:
   We can move this to a base class method, which can be used every where.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to