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

   ## What changes were proposed in this pull request?
   HDDS-14435. Fix snapshotUsedNamespace underflow when FSO directory is 
deleted and purged
   
   Please describe your PR in detail:
     • The Problem: FSO directories have no blocks, so directory deletion 
incorrectly evaluated to  isKeyNonEmpty = false . This decremented the active
     bucket namespace  usedNamespace  but did not increment  
snapshotUsedNamespace , causing a mismatch when the directory was later purged 
(unconditionally
     decrementing  snapshotUsedNamespace  by 1 and underflowing the count to  
-1 ).
     • The Fix: Updated OMKeyDeleteRequestWithFSO.java to shift the namespace 
quota to the snapshot namespace on deletion if it is either a non-empty key or a
   directory (
     isKeyNonEmpty || keyStatus.isDirectory() ).
     • Test Utils Alignment: Updated mock  deleteDir  helper in 
OMRequestTestUtils.java to align with actual deletion quota tracking.
     • Regression Test: Added a test case  
testSnapshotUsedNamespaceAfterDirectoryDeleteAndPurge  in 
TestOMKeyDeleteRequestWithFSO.java to verify that
   directory deletion
     followed by a purge does not cause negative  snapshotUsedNamespace  values.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-14435
   
   ## How was this patch tested?
   
   New unit test


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