zhangyue19921010 opened a new issue, #11259: URL: https://github.com/apache/paimon/issues/11259
### Search before asking - [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar. ### Paimon version Master `79b8ec4788e2cd8ed87b1745d5ca54aa8db0e293`. ### Compute Engine Java Table API, OpenJDK 11.0.18, Parquet. ### Minimal reproduce step 1. Create a primary-key table with `k INT`, `v INT`, primary key `k`, and `bucket=1`. Write `(1, 10)` and `(2, 20)`, then save the committed snapshot ID. 2. Write `(1, 11)`, commit, and run full compaction so the latest snapshot uses a new data file. 3. Plan a bounded read with `incremental-between=<saved snapshot>,<latest snapshot>` and `incremental-between-scan-mode=diff`. 4. Use a FileIO implementation that throws an `IOException` when opening the new snapshot's data file. In the regression, `TraceableFileIO` tracks the real Parquet streams and a small subclass injects this failure. Reader creation throws as expected, but the previously opened old-snapshot input stream remains open. There is no returned reader for the caller to close. ### What doesn't meet your expectations? A failed diff-reader initialization should close the readers it has already opened. `IncrementalDiffSplitRead` currently constructs both endpoint readers before handing them to `MergeSorter`, so a failure opening the second reader bypasses the existing cleanup owner. ### Anything else? Supply both endpoint readers lazily to `MergeSorter.mergeSortNoSpill`, which already closes successfully opened readers when a later supplier throws an `IOException`. ### Are you willing to submit a PR? - [x] I'm willing to submit a PR! -- 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]
