Gabriel39 commented on PR #66498: URL: https://github.com/apache/doris/pull/66498#issuecomment-5301378822
**[P1] UPDATE and MERGE UPDATE still need a concurrency fence** This remains unresolved at the current head `b9654b2b612`. Both `PaimonRowChangePlanBuilder.buildUpdate()` and `PaimonMergePlanner.buildUpdateProjection()` read the target row and construct a complete `UPDATE_AFTER` row by copying every unassigned column from that scan. The sink and commit path do not carry the scan snapshot ID or any per-key version that can detect a concurrent change. For example, assume the current row is: ```text (id=1, a=0, b=0, seq=10) ``` 1. Doris scans the row and prepares `UPDATE SET a = 1`, producing the full row `(1, 1, 0, 10)`. 2. Before Doris commits, another writer commits `(1, 0, 2, 11)` for the same key. 3. Doris then commits its row derived from the stale snapshot. Without sequence ordering, the Doris row can overwrite `b=2` with the stale `b=0`, causing a lost update. With `sequence.field=seq`, Paimon can retain the concurrent row with `seq=11` and discard the Doris row with `seq=10`; Doris may still report the statement as successful even though `a` was never updated. Commit-level manifest conflict handling does not provide row-level compare-and-swap semantics here. Please either fence the operation against the starting snapshot, detect per-key version changes, serialize row-change DML, or retry the entire statement from a fresh scan when the target changes. A commit retry alone is insufficient because it would reuse the stale projected rows. Please add concurrent UPDATE and MERGE UPDATE tests covering both lost-update and sequence-field cases. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
