Skip to content

Commit b791dbd

Browse files
committed
[Bug] Capture snapshot UUID in single-arg setRowIdCheckFromSnapshot for ABA detection (#9363)
The single-argument setRowIdCheckFromSnapshot(Long) was passing null for the base snapshot UUID, causing the ABA check in checkForRowIdFromSnapshot to never be invoked. This fix captures the UUID from the snapshot manager in the single-arg method so that even callers using the single-arg API benefit from ABA protection.
1 parent 777fddd commit b791dbd

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎paimon-core/src/main/java/org/apache/paimon/operation/commit/DataEvolutionConflictDetection.java‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,17 @@ public DataEvolutionConflictDetection(
103103

104104
@Override
105105
public void setRowIdCheckFromSnapshot(@Nullable Long rowIdCheckFromSnapshot) {
106+
String uuid = null;
107+
if (rowIdCheckFromSnapshot != null) {
108+
try {
109+
Snapshot snapshot = snapshotManager.snapshot(rowIdCheckFromSnapshot);
110+
uuid = snapshot.uuid();
111+
} catch (RuntimeException e) {
112+
// snapshot file missing, leave uuid as null
113+
}
114+
}
106115
setRowIdCheckFromSnapshot(
107-
rowIdCheckFromSnapshot, null, DataEvolutionDmlRowIdConflictCheck.INSTANCE);
116+
rowIdCheckFromSnapshot, uuid, DataEvolutionDmlRowIdConflictCheck.INSTANCE);
108117
}
109118

110119
@Override

0 commit comments

Comments
 (0)