hanishakoneru opened a new pull request #3232:
URL: https://github.com/apache/ozone/pull/3232
## What changes were proposed in this pull request?
When a key is deleted from OM, only the latest version of blocks are sent to
SCM for deletion.
In OmMetadataManagerImpl#getPendingDeletionKeys(), we gey the latest version
location information and return only those blocks for deletion to
KeyDeletingService. This leads to older versions of blocks being orphaned.
```
RepeatedOmKeyInfo infoList = kv.getValue();
// Get block keys as a list.
for (OmKeyInfo info : infoList.getOmKeyInfoList()) {
OmKeyLocationInfoGroup latest = info.getLatestVersionLocations();
List<BlockID> item = latest.getLocationList().stream()
.map(b -> new BlockID(b.getContainerID(), b.getLocalID()))
.collect(Collectors.toList());
BlockGroup keyBlocks = BlockGroup.newBuilder()
.setKeyName(kv.getKey())
.addAllBlockIDs(item)
.build();
keyBlocksList.add(keyBlocks);
currentCount++;
}
```
This PR proposes to return all blocks from all versions of a key to
KeyDeletingService when a key is marked for deletion.
## What is the link to the Apache JIRA
Please replace this section with the link to the Apache
JIRA)](https://issues.apache.org/jira/browse/HDDS-6502)
## How was this patch tested?
Added unit test
--
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]