Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-4565. [FSO]Delete : quotaReleased on directory deletion should consider all sub paths #3964

Closed
wants to merge 1 commit into from

Conversation

sumitagrawl
Copy link
Contributor

What changes were proposed in this pull request?

While delete keys in background service for recursive cleanup, cleanup of key's space and its namespace is added in purge of keys.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-4565

How was this patch tested?

Test is done considering below scenario:

  1. single file remove with delete folder hierarchy
  2. multiple files in different level with delete folder hierarchy
  3. multiple files in same level with delete folder hierarchy

@sumitagrawl
Copy link
Contributor Author

@nandakumar131 @ChenSammi Plz review

Copy link
Contributor

@sadanand48 sadanand48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sumitagrawl for working on this, This PR provides fix for non-FSO buckets, I think we should remove FSO tag from title and jira.

@@ -1242,24 +1239,13 @@ public List<BlockGroup> getPendingDeletionKeys(final int keyCount)
if (kv != null) {
RepeatedOmKeyInfo infoList = kv.getValue();
for (OmKeyInfo info : infoList.cloneOmKeyInfoList()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for loop can be avoided here, we can use list.addAll() . currrentCount will be size of the list.

for (DeletedKeys bucketWithDeleteKeys : bucketDeletedKeysList) {
String volumeName = bucketWithDeleteKeys.getVolumeName();
String bucketName = bucketWithDeleteKeys.getBucketName();
OmBucketInfo omBucketInfo = getBucketInfo(omMetadataManager, volumeName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are updating bucketTable metadata here , bucket lock needs to be acquired, else someone can delete the bucket.

.collect(Collectors.toList()).size() == 3;
.mapToInt(e -> e.getKeyLocationVersions().stream()
.map(OmKeyLocationInfoGroup::getLocationList).
mapToInt(List::size).sum()).sum() == 3;
} catch (IOException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a unit test to verify updation of the usedBytes and namespace after key cleanup.

@sumitagrawl sumitagrawl deleted the HDDS-4565 branch November 17, 2022 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants