devmadhuu opened a new pull request, #9207:
URL: https://github.com/apache/ozone/pull/9207

   ## What changes were proposed in this pull request?
   This PR change is to fix the issue where number of keys showing wrong value 
when creating dirs and keys inside a FSO bucket using `ozone fs -mkdir` option.
   
   As per initial analysis, below is the cause of this issue:
   The issue was in the  `handlePutKeyEvent`  method in 
`NSSummaryTaskDbEventHandler.java` When a file is created, if its parent 
directory's NSSummary doesn't exist in the in-memory map or database, the
     code creates a new NSSummary with default values, including parentId = 0. 
This breaks the propagation chain, preventing key counts from being propagated 
to ancestor directories and the bucket.
   
     This can occur when:
     1. Directory creation events and file creation events are processed in 
different batches
     2. Directory NSSummaries haven't been persisted to the DB when file events 
arrive
     3. This can happen when directory creation events and file creation events 
are processed in different batches. Could be because of recent optimizations 
done at OM for batch processing.
   
     When the propagation chain is broken (parentId = 0), the 
propagateSizeUpwards method stops propagating counts upward, resulting in 
incorrect total key counts at the bucket level.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-13841
   
   ## How was this patch tested?
   Patch is tested using existing junit and integration tests and manually 
using local docker cluster.
   <img width="1496" height="606" alt="image" 
src="https://github.com/user-attachments/assets/4e63800a-4425-4bc3-88e7-0a6def9109b9";
 />
   
   


-- 
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