jordepic opened a new pull request, #10568: URL: https://github.com/apache/paimon/pull/10568
### Purpose Primary-key full-compaction commits currently publish APPEND and COMPACT snapshots with the same commit identifier. Recovering after APPEND is durable can filter the identifier as already committed and discard required final changelog/index work. Batch readers then see the new value while incremental readers miss its final change. This is tracked by [StreamFusion #318](https://github.com/datafusion-contrib/StreamFusion/issues/318); this PR proposes the upstream recovery fix against current Apache master. For ordinary full-compaction/lookup commits with required compact changelog or index work, publish data and that work atomically in one APPEND snapshot, marked with an explicit protocol version. Retain recovery of legacy unmarked incomplete APPEND/COMPACT pairs. Competing full compactions need more than preserving the old compact messages: refresh against a pinned current committed snapshot plus the pending raw input, recompute the compaction, publish the resulting data/changelog together, and signal the caller to refresh its stale writer. The durable identifier still deduplicates retry. Full-compaction writer checkpoint recovery also rebuilds from completed atomic state while preserving pending uncommitted raw input, including when prepared derived outputs have been removed or later ordinary APPENDs exist. Data-evolution and other producer paths retain their existing protocol. Injected filesystem failures also exposed reader cleanup gaps: unchecked schema-lookup failures could leak readers opened earlier, and batch-release failure could prevent closing other loser-tree leaves. The separate first commit closes all owned readers and preserves primary/suppressed failures. ### Tests - Normal Maven reactor verification (without `fast-build`, with style/checkstyle/enforcer/licensing checks): **352 passed, one opt-in performance test skipped**. Includes the unchanged 101-case commit suite, 39 recovery cases, 201 loser-tree cases, three construction-ownership cases, six writer tests and two write-restore tests. - Three additional unchanged multi-writer conflict runs: **18 cases passed**. No original assertions or deadlines changed. - Recovery tests cover publication crash points, legacy incomplete pairs, direct/filter retries, multiple pending identifiers, index-only work, expired history, competing full compaction/file upgrades, writer restore with pending input and later ordinary APPENDs, and batch/incremental final results. - Opt-in commit-API-only comparison against pristine Apache master `937b5e1d51a5d346634df56794c562150aa1a2b5`: 16 commits per trial, two warmups and three trials. Mean publication time at 64 keys: stock 0.11626s / candidate 0.09651s (1.20x); at 4096 keys: stock 0.11456s / candidate 0.09299s (1.23x). Variance is retained; writing/compaction/prepare and verification reads are outside timing. These are publication measurements, not whole-job acceleration claims. The local selection is not a claim that the complete upstream integration matrix has passed; upstream CI and review remain required. StreamFusion continues to use canonical released dependencies. Upstream review and a verified canonical release are still required before adopting this recovery change there. -- 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]
