-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-13188. Track total pending deletion size for FSO directories in OM via Recon #8591
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
Merged
+45
−0
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f6f1c13
HDDS-13188. Track total pending deletion size for FSO directories in OM
d1f60c8
Address review comments
c05b31e
Update TODO for calculateTotalPendingDeletedDirSizes
6644135
Rename endpoint name and JSON output fields
26544cb
Merge remote-tracking branch 'upstream/HDDS-13177' into HDDS-13188
ce42be8
Fix TODO
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @tanvipenumudy
Currently, we iterate through the
DeletedDirectoryTable, calculate the size of each deleted directory, and then find the sum total size. The issue arises when both the parent and child entries are encountered in the DeletedDirectoryTable, resulting in the same size being calculated twice.Are we going to consider this scenario?
Or is this scenario even possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ArafatKhan2198 for the review, yes for the FSO deleted directory space calculation - it is indeed possible that both the parent and child directory entries might coexist within the
deletedDirectoryTable, but this wouldn't result in double counting of the child directory's size because of how Recon processes delete events today, let's consider the below two scenarios for example:Case 1:
/dir1/dir2, ifdir1(parent) is deleted first -> then/dir1and/dir1/dir2wouldn't coexist in thedeletedDirectoryTableat any given point in time (the directories would land in thedeletedDirectoryTablein order from top to bottom) -> this shouldn't cause any impact.Case 2:
/dir1/dir2, if/dir1/dir2is deleted first following which/dir1is deleted, then both/dir1/dir2and/dir1can coexist in thedeletedDirectoryTable.This wouldn't double-calculate the size of
/dir1/dir2when both/dir1/dir2and/dir1are in thedeletedDirectoryTablebecause Recon detaches the/dir1/dir2(child directory) from its parent (/dir1) in the NSSummaryTree as and when it sees this delete directory event.Our approach would iterate over Recon's
deletedDirectoryTableentries and recursively calculate the sizes of the entry's sub-directories:/dir1/dir2in thedeletedDirectoryTable, recursively calculate the sizes of directories under it./dir1in thedeletedDirectoryTable, but since the child tree is detached -> we would only be recursively calculating the sizes of its existing sub-directories.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking another example for better clarity, consider the following directory structure:
Suppose
/dir1/dir2/dir3is deleted first, followed by the deletion of/dir1:/dir1/dir2and/dir1/dir2/dir3would be detached.deletedDirectoryTableentries:/dir1/dir2/dir3indeletedDirectoryTable→
/dir1/dir2/dir3.getSizeOfAllFiles()= 2 GB (file4 and file5)/dir1indeletedDirectoryTable→ size of
/dir1would be calculated as:/dir1.sizeOfAllFiles()→ 1 GB (file1) +recursiveSizeOfSubDirs(/dir1):/dir1/dir4.sizeOfFiles()→ 2 GB (file2 and file6) + no sub-directories./dir1/dir2.sizeOfFiles()→ 1 GB (file3) + no sub-directories (as/dir1/dir2/dir3is detached)./dir1= 1 GB + 2 GB + 1 GB = 4 GB.So the total FSO deleted directory space would be: 2 GB (
/dir1/dir2/dir3) + 4 GB (/dir1with detached child:/dir1/dir2/dir3) = 6 GB.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks tanvi for the detailed explanation on this!
It makes sense.