ayushtkn commented on a change in pull request #1682:
URL: https://github.com/apache/ozone/pull/1682#discussion_r543861121



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java
##########
@@ -192,6 +193,17 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
             KEY_NOT_FOUND);
       }
 
+      if (ozoneManager.getEnableFileSystemPaths()) {
+        // Ensure the parent exist.
+        if (!"".equals(OzoneFSUtils.getParent(keyName))

Review comment:
       Thanx @bharatviswa504 for the review.
   
   >Right now delete/rename is not an atomic operation, so will just checking 
the parent Dir is enough?
   
   Is there anything else, that can be checked? Yahh, there might be some issue 
because of non atomic behaviour delete/rename. Will pulling this check inside 
lock, solve them or lead to a better state?
   
   >And also for performance reasons, can we leave allocateBlock, as during 
KeyCommit anyway we shall figure it out?
   
   
   Rakesh suggested to add the check in `allocateBlock`, I think for a 
`fail-fast` approach, If we tend to fail during the commit phase and we know 
that at the `allocateBlock` phase, we should fail at an earlier stage itself, 
rather than going till the end. Might save a messed up client, if he is writing 
a big file.
   
   But I am not very aware about the performance impacts and HDDS-2939 both, so 
I am ok both ways.
   
   @rakeshadr any thoughts on this?




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to