HDDS-9426. Calculate Exclusive size for deep cleaned snapshot's deleted directories #6099
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.
What changes were proposed in this pull request?
The original patch #5579 was reverted due to incompatible
proto.lockchanges and hence reverted in #6051. Theproto.lockis now merged to master in #6080 . Hence re-raising the PR. Copying the original PR description here for context.Original PR description
In #5339, We expanded the snapshot's
deletedDirTableintofileTableto calculate the exclusive size for the files under the deleted directories. The problem with that approach is that if we alter thefileTableanddirTableof a snapshot, it would change thesnapDiffresult and yield undesirable results. For eg, Consider a deleted directory structure as below,In the new approach in this patch, We do an in-memory walk for each deleted directory and deep clean them, and also calculate the
exclusive sizefor files when doing so. For each file, we do the same as #5301The reason we are doing a deep clean, There could be files under a directory trapped in between snapshots. Consider this case,
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9426
How was this patch tested?
Added Integration test.