ArafatKhan2198 commented on PR #8797:
URL: https://github.com/apache/ozone/pull/8797#issuecomment-3151273723

   @devmadhuu @sumitagrawl 
   
   I found a bug in my implementation code that handles directory deletions. 
When a directory is deleted, the system correctly updates the parent 
directory's total file count and size, but it fails to accurately update the 
file size distribution histogram. This leads to incorrect information about the 
size categories of files in the parent directory.
   
   ### Simple Example
   
   Imagine a directory `/home` with two subdirectories:
   
   - `/home/dir_A` (contains one 100-byte file)
   - `/home/dir_B` (contains one 500-byte file)
   
   The file size distribution for `/home` should show one file in the 
"100-byte" bin and one file in the "500-byte" bin.
   
   When `/home/dir_B` is deleted, the bug causes the system to only decrement 
the total file count and size of `/home`. The file size distribution for 
`/home` would still incorrectly show a file in both the "100-byte" and 
"500-byte" bins, even though the 500-byte file is gone.
   
   I have applied a fix to ensures that when a directory is deleted, the parent 
directory's file size distribution is correctly updated by subtracting the 
specific file size distribution of the deleted directory. After the fix, 
deleting `/home/dir_B` would result in `/home`'s distribution correctly showing 
only one file in the "100-byte" bin.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to