JingsongLi commented on code in PR #11174:
URL: https://github.com/apache/paimon/pull/11174#discussion_r4588469602
##########
paimon-core/src/main/java/org/apache/paimon/operation/commit/DataEvolutionConflictDetection.java:
##########
@@ -494,7 +508,10 @@ private Optional<RuntimeException>
checkForRowIdFromSnapshot(
DataFileMeta file = entry.file();
if (file.firstRowId() != null
&& file.nonNullRowIdRange().from < checkNextRowId
- && conflictChecker.conflictsWith(file)) {
+ && ((conflictChecker != null &&
conflictChecker.conflictsWith(file))
+ || deletedRowRanges.intersects(
Review Comment:
[P1] Reject stale replacements after anchor row-ID reassignment
The new DV check uses the anchors' current ranges, but the surrounding
condition still discards history at or beyond the preparation snapshot's
`nextRowId`. Metadata-only `reassign_row_id` moves existing anchors into
precisely that range without changing their physical file names, so a later
update can escape this check.
I reproduced this on `29ecc748d8` with a real partitioned DE + row-tracking
+ DV + write-only table `(id INT, value STRING, pt STRING)`: commit
`(1,'old','a')`, `(9,'other','b')`, `(2,'third','a')` separately; prepare
replacement of `id=1`; run public `CALL sys.reassign_row_id(table =>
'target')`; run `UPDATE target SET id=8, value='concurrent' WHERE pt='a' AND
id=1`; then commit the original messages with their original
`withCheckFromSnapshot` bound. The commit succeeds and returns
`(1,'replacement','a'), (2,'third','a'), (9,'other','b')`: the concurrent
`id=8` row is silently lost even though it no longer matches the source key.
The identical no-reassignment control correctly rejects the commit and retains
`id=8`.
Please reject/replan when a referenced anchor's row-ID mapping changes after
the baseline, or consistently remap the affected historical ranges. Removing
only the cutoff does not cover updates preceding reassignment. Add this
maintenance/update/replacement interleaving to the conflict regressions.
--
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]