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

   ### Purpose
   
   close #10126
   
   `ChainTableCommitPreCallback` rejects dropping a snapshot partition of a 
chain table whose delta followers would lose their baseline. Its predecessor 
and successor candidates came from the pre-commit partition list, so when one 
commit dropped several partitions of a chain group at once (a batch INSERT 
OVERWRITE or a rollback), a partition dropped by that same commit still counted 
as the predecessor of the next one. The check passed, the commit landed, and 
the delta partitions silently fell back to delta-only reads without their 
baseline rows.
   
   This validates the post-commit state instead. A partition counts as dropped 
only when the commit deletes all of its base files; a rollback deletes per-file 
and may leave a partition partially alive, and such a partition survives and 
still anchors its delta followers, so it is neither removed from the candidate 
list nor itself re-validated. Only fully dropped partitions are excluded from 
the candidates and validated, so a same-commit-dropped partition can no longer 
masquerade as another's predecessor. Single-partition drops are unaffected.
   
   ### Tests
   
   
`ChainTablePartitionExpireTest#testRollbackRejectedWhenBatchDroppingBaselinesOfDelta`:
 one rollback drops both `CN/20250201` and `CN/20250301` of a chain group while 
a delta `CN/20250315` follows. Pre-fix the pre-commit list let `CN/20250201` 
serve as `CN/20250301`'s predecessor, so the drop was accepted and the delta 
lost its baseline; the test now asserts the commit is rejected and the latest 
snapshot is unchanged. It fails against the pre-fix code on both assertions.
   
   
`ChainTablePartitionExpireTest#testRollbackAllowedWhenPartitionOnlyPartiallyDeleted`:
 a rollback that deletes only one of two files of `CN/20250201` (leaving it 
alive) while fully dropping `CN/20250301` is allowed, because the surviving 
`CN/20250201` still anchors the delta. This guards against a false rejection on 
a partial delete.
   
   ### 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