Hanisha Koneru created HDDS-6502:
------------------------------------
Summary: Blocks of old key versions are not deleted on key deletion
Key: HDDS-6502
URL: https://issues.apache.org/jira/browse/HDDS-6502
Project: Apache Ozone
Issue Type: Bug
Reporter: Hanisha Koneru
Assignee: Hanisha Koneru
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.
{code:java}
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++;
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]