jojochuang commented on code in PR #4629:
URL: https://github.com/apache/ozone/pull/4629#discussion_r1181921067


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -227,7 +227,11 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
       long correctedSpace = omKeyInfo.getReplicatedSize();
       // if keyToDelete isn't null, usedNamespace needn't check and
       // increase.
-      if (keyToDelete != null && !omBucketInfo.getIsVersionEnabled()) {
+      if (keyToDelete != null && isHSync) {

Review Comment:
   This is okay now when we essentially allocate just one block at a time. The 
internal logical does permit OM to request more than one block when file is 
created. I am not sure when that happens, but a full solution would need to 
somehow record the allocated but uncommitted blocks when hsync. For example, it 
could be achieved by making a deep copy of the openFileTable entry.



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