Himanshu-2005-code opened a new pull request, #27617:
URL: https://github.com/apache/datafusion/pull/27617

   ## Which issue does this PR close?
   
   - Closes #24230.
   
   ## Rationale for this change
   
   `FileSpillWriter::write` charges `used_disk_space` before calling 
`write_all`. If `write_all` fails with an I/O error, the reservation is never 
released, so the counter stays inflated and spill capacity shrinks until the 
process restarts. The quota-exceeded path already rolls back (#21882); this 
fixes the remaining I/O error path called out in the issue.
   
   ## What changes are included in this PR?
   
   - Release the reservation when the underlying `write_all` fails.
   - Regression test `test_rollback_on_io_error_then_drop_returns_to_zero`.
   
   ## What is the testing strategy for this PR?
   
   The new unit test forces a write failure using a read-only file handle and 
checks that the counter returns to its prior value, and to 0 after all files 
drop. It fails on `main` (counter left at 14 instead of 5) and passes with the 
fix.
   
   ```
   cargo test -p datafusion-execution --lib disk_manager
   ```
   
   ## Are there any user-facing changes?
   
   No API change. A failed spill write no longer permanently reduces remaining 
spill capacity.
   
   This PR was written with AI assistance (Claude); I reviewed and tested the 
change.


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