Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-6548 HDDS Stability Fixes and Improvements
  3. HDDS-6502

Blocks of old key versions are not deleted on key deletion

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • None

    Description

      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++;
      }
      

      Attachments

        Issue Links

          Activity

            People

              hanishakoneru Hanisha Koneru
              hanishakoneru Hanisha Koneru
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: