swamirishi commented on code in PR #9122:
URL: https://github.com/apache/ozone/pull/9122#discussion_r2416876122
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java:
##########
@@ -191,38 +233,51 @@ private Pair<Pair<Integer, Long>, Boolean>
submitPurgeKeysRequest(
// Step 1: Process DeleteBlockGroupResults
for (DeleteBlockGroupResult result : results) {
- String deletedKey = result.getObjectKey();
- if (result.isSuccess()) {
- // Add key to PurgeKeys list.
- if (keysToModify != null && !keysToModify.containsKey(deletedKey)) {
- // Parse Volume and BucketName
- purgeKeys.add(deletedKey);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Key {} set to be updated in OM DB, Other versions " +
- "of the key that are reclaimable are reclaimed.", deletedKey);
+ String deletedKeyGroup = result.getObjectKey();
+ PurgedKey purgedKey = purgedKeys.get(deletedKeyGroup);
+ if (purgedKey != null) {
+ String deletedKeyName = purgedKey.getDeleteKeyName();
+ if (result.isSuccess()) {
+ // Add key to PurgeKeys list.
+ if (keysToModify == null ||
!keysToModify.containsKey(deletedKeyName)) {
+ completePurgedKeys.add(deletedKeyName);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Key {} set to be purged from OM DB", deletedKeyName);
+ }
+ } else {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Key {} set to be updated in OM DB, Other versions " +
+ "of the key that are reclaimable are reclaimed.",
deletedKeyName);
+ }
}
- } else if (keysToModify == null) {
- purgeKeys.add(deletedKey);
+ deletedReplSize += purgedKey.getPurgedBytes();
+ deletedCount++;
+ } else {
+ // If the block deletion failed, then the deleted keys should also
not be modified and
+ // any other version of the key should also not be purged.
+ failedDeletedKeys.add(deletedKeyName);
+ purgeSuccess = false;
if (LOG.isDebugEnabled()) {
- LOG.debug("Key {} set to be purged from OM DB", deletedKey);
+ LOG.error("Failed Block Delete corresponding to Key {} with block
result : {}.", deletedKeyName,
+ result.getBlockResultList());
+ } else {
+ LOG.error("Failed Block Delete corresponding to Key {}.",
deletedKeyName);
Review Comment:
We don't want to Log all block results which could be huge in some cases
this might flood the logs if we log it over and over again.
--
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]