LuciferYang opened a new pull request, #10074:
URL: https://github.com/apache/paimon/pull/10074

   ### Purpose
   
   close #10066
   
   `Sorter.close()` closed the `IOManager` it was handed, but that IOManager 
belongs to the write and is shared by everything the write does. Its spill 
directories are created once, when the manager is constructed, so closing it 
deletes them. After the first incremental clustering of a bucketed append-only 
table, any later spill of the same write instance (for example the next 
clustering round) then fails with `FileNotFoundException`.
   
   This leaves the caller-owned IOManager open. The sorter's own resources are 
fully released by `buffer.clear()`, which deletes its spill channels through 
the buffer's private `SpillChannelManager`, so nothing sorter-owned leaks. It 
also closes the `RecordReaderIterator` the sorter consumes, which 
`clusterRewrite` never closed before.
   
   ### Tests
   
   
`BucketedAppendClusterManagerTest.testClusterRewriteTwiceKeepsSharedIOManagerUsable`:
 clusters the same bucketed append-only write twice with a tiny write buffer 
and page size so both rounds spill to disk, and asserts both rounds produce 
output. Against the pre-fix code the second round fails with 
`FileNotFoundException` because the first round's `Sorter.close()` deleted the 
shared IOManager's spill directory.
   


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

Reply via email to