swamirishi commented on code in PR #8587:
URL: https://github.com/apache/ozone/pull/8587#discussion_r2411610306
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java:
##########
@@ -187,17 +187,19 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager, Execut
}
}
- long quotaReleased = 0;
OmBucketInfo omBucketInfo =
getBucketInfo(omMetadataManager, volumeName, bucketName);
Map<String, OmKeyInfo> openKeyInfoMap = new HashMap<>();
// Mark all keys which can be deleted, in cache as deleted.
- quotaReleased =
+ Pair<Long, Integer> quotaReleasedEmptyKeys =
markKeysAsDeletedInCache(ozoneManager, trxnLogIndex, omKeyInfoList,
- dirList, omMetadataManager, quotaReleased, openKeyInfoMap);
- omBucketInfo.incrUsedBytes(-quotaReleased);
- omBucketInfo.incrUsedNamespace(-1L * omKeyInfoList.size());
+ dirList, omMetadataManager, openKeyInfoMap);
+ omBucketInfo.decrUsedBytes(quotaReleasedEmptyKeys.getKey(), true);
+ // For empty keyInfos the quota should be released and not added to
namespace.
+ omBucketInfo.decrUsedNamespace(omKeyInfoList.size() + dirList.size() -
+ quotaReleasedEmptyKeys.getValue(), true);
+ omBucketInfo.decrUsedNamespace(quotaReleasedEmptyKeys.getValue(), false);
Review Comment:
Empty keys are never added into the deletedTable
https://github.com/apache/ozone/blob/bbe9ada8afb188fd6e9a8fc12c42132e7efd0c01/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/AbstractOMKeyDeleteResponse.java#L70-L88
--
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]