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

   ## What changes were proposed in this pull request?
   Saw this warning when datanode disk was nearly full:
   ```
   2025-12-15 10:37:20,903 WARN 
[166c5ca8-343e-46ed-b619-84ac193e0069-ChunkReader-215]-org.apache.hadoop.hdds.fs.CachingSpaceUsageSource:
 Attempted to decrement available space to a negative value. Current: 0, 
Decrement: 1048576, Source: /ipdr_ozone31/hadoop-ozone/datanode/data
   ```
   Prior to this message, there were many failed writes. Perhaps it needs to 
increment the value when the write fails.
   
   The fix adds rollback logic in `KeyValueHandler.handleWriteChunk()` that 
tracks when a chunk write succeeds and increments the `usedSpace` counter. If 
any subsequent operation fails, the exception handler calls 
`volume.decrementUsedSpace()` to restore the counter.
   
   ## What is the link to the Apache JIRA
   [HDDS-14183](https://issues.apache.org/jira/browse/HDDS-14183)
   
   ## How was this patch tested?
   CI: https://github.com/sarvekshayr/ozone/actions/runs/21200210393
   


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