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

   ### Purpose
   
   Reading a table with `scan.mode=compacted-full` crashed at scanner 
construction when `full-compaction.delta-commits` was set to 0. The option 
accepts 0 (meaning no periodic full compaction) and has no validator rejecting 
it, while `FullCompactedStartingScanner` computed `identifier % deltaCommits` 
and threw `ArithmeticException`. The write path already clamps this value to 1 
in `StoreSinkWrite`, so the read side now clamps the same way with 
`Math.max(deltaCommits, 1)`.
   
   Separately, `ContinuousCompactorStartingScanner`, the dedicated compaction 
job's startup scanner, walked latest to earliest with 
`SnapshotManager.snapshot(id)`, which throws when a snapshot in that range is 
expired concurrently by another job. It now reads via `tryGetSnapshot(id)` and 
skips missing snapshots, matching the behavior the sibling scanners already get 
from `SnapshotManager.pickOrLatest`.
   
   ### Tests
   
   `FullCompactedStartingScannerTest.testZeroDeltaCommitsClampedToOne` builds 
the scanner with `deltaCommits=0` and asserts it picks the latest compact 
snapshot instead of throwing.
   
   `ContinuousCompactorStartingScannerTest.testScanSkipsExpiredSnapshots` 
deletes the latest compact snapshot file behind the manager, simulating 
concurrent expiry, and asserts the scan falls back to the earlier compact 
snapshot instead of failing.
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.
   


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