bharatviswa504 commented on a change in pull request #1361:
URL: https://github.com/apache/hadoop-ozone/pull/1361#discussion_r485293304



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
##########
@@ -158,6 +159,23 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
 
       validateBucketAndVolume(omMetadataManager, volumeName, bucketName);
 
+      // Check by the time we commit this file, is there any directory
+      // created if then fail it. This is being done for correctness.
+
+      // For now we are taking this approach similar to local file creation.
+      // TODO: In future this can be revisited to come up with an advanced
+      // approach.
+
+
+      if (ozoneManager.getEnableFileSystemPaths()) {
+        if (checkDirectoryAlreadyExists(volumeName, bucketName, keyName,

Review comment:
       >Does the directory name have a trailing / in RocksDB? 
   Yes.
   
   >If so, do we need to append it to keyname before calling 
checkDirectoryAlreadyExists?
   That is taken care of by the implementation of checkDirectoryAlreadyExists.
   Where it uses getOzoneDirKey which appends "/"

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
##########
@@ -158,6 +159,23 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
 
       validateBucketAndVolume(omMetadataManager, volumeName, bucketName);
 
+      // Check by the time we commit this file, is there any directory
+      // created if then fail it. This is being done for correctness.
+
+      // For now we are taking this approach similar to local file creation.
+      // TODO: In future this can be revisited to come up with an advanced
+      // approach.
+
+
+      if (ozoneManager.getEnableFileSystemPaths()) {
+        if (checkDirectoryAlreadyExists(volumeName, bucketName, keyName,

Review comment:
       >Does the directory name have a trailing / in RocksDB? 
   Yes.
   
   >If so, do we need to append it to keyname before calling 
checkDirectoryAlreadyExists?
   
   That is taken care of by the implementation of checkDirectoryAlreadyExists.
   Where it uses getOzoneDirKey which appends "/"

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
##########
@@ -158,6 +159,23 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
 
       validateBucketAndVolume(omMetadataManager, volumeName, bucketName);
 
+      // Check by the time we commit this file, is there any directory
+      // created if then fail it. This is being done for correctness.
+
+      // For now we are taking this approach similar to local file creation.
+      // TODO: In future this can be revisited to come up with an advanced
+      // approach.
+
+
+      if (ozoneManager.getEnableFileSystemPaths()) {
+        if (checkDirectoryAlreadyExists(volumeName, bucketName, keyName,

Review comment:
       >Does the directory name have a trailing / in RocksDB? 
   
   Yes.
   
   >If so, do we need to append it to keyname before calling 
checkDirectoryAlreadyExists?
   
   That is taken care of by the implementation of checkDirectoryAlreadyExists.
   Where it uses getOzoneDirKey which appends "/"




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



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

Reply via email to