You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/09/09 02:02:39 UTC

[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #1361: HDDS-4155. Directory and filename can end up with same name in a path.

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



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