-
Notifications
You must be signed in to change notification settings - Fork 580
HDDS-13841. Namespace summary API gives wrong count of directories and keys. #9213
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
Conversation
priyeshkaratha
left a comment
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 @ArafatKhan2198 for the patch. Code looks fine for me.
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 @ArafatKhan2198 for the patch. Just few nits. Pls check.
- Also add in PR description for
ozone sh putcommands testing. - And mention the difference in detail in PR description why this bug surface out because of difference in events from OM in
ozone fs -mkdirandozone sh putcommands along with the full sequence of list of events. - Also check CI test failures of Recon.
...one/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java
Outdated
Show resolved
Hide resolved
...one/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java
Show resolved
Hide resolved
|
Can we also add few integration tests for both approaches including |
sumitagrawl
left a comment
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.
LGTM
|
A detailed Explanation on how the Issue was caught - https://issues.apache.org/jira/browse/HDDS-13841#:~:text=How%20We%20Uncovered%20This%20Issue
|
devmadhuu
left a comment
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 @ArafatKhan2198 for improving the patch. LGTM +1
What changes were proposed in this pull request?
A detailed Explanation on how the Issue was caught - https://issues.apache.org/jira/browse/HDDS-13841#:~:text=How%20We%20Uncovered%20This%20Issue
Bug:
Namespace summaries displayed incorrect file sizes and counts for directories. When a directory containing files was added to the tree, its immediate parent directory was not updated with the correct totals.
Root Cause:
The
handlePutDirEventmethod calledpropagateSizeUpwards(parentObjectId, ...)to propagate size changes. However,propagateSizeUpwards(objectId, ...)updates the parent of the given objectId, not the objectId itself.By passing
parentObjectId, the method updated:This caused the immediate parent to have missing or incorrect size and file count totals.
Fix:
Changed
handlePutDirEventto callpropagateSizeUpwards(objectId, ...)instead, passing the child directory's objectId. This ensures the immediate parent and all ancestors are updated correctly.Also simplified
handleDeleteDirEventto follow the same pattern, removing redundant code and ensuring consistency across both methods.Impact:
Namespace summaries now display accurate file sizes and counts for all directories, with correct propagation through the entire parent chain.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-13841
How was this patch tested?
Tested locally by creating a nested directory structure with files and verifying namespace summary totals at each level.
Test commands:
Using
ozone fsUsing
ozone shVerified structure with correct namespace summary totals:
Before the fix:
dir1would show incorrect totals (missing counts/sizes from subdirectories)After the fix: All directories show correct cumulative file counts and sizes, including all nested subdirectories.