JingsongLi commented on code in PR #7323:
URL: https://github.com/apache/paimon/pull/7323#discussion_r2878133179


##########
paimon-python/pypaimon/write/file_store_commit.py:
##########
@@ -296,8 +339,20 @@ def _try_commit_once(self, retry_result: 
Optional[RetryResult], commit_kind: str
             # Assign row IDs to new files and get the next row ID for the 
snapshot
             commit_entries, next_row_id = 
self._assign_row_tracking_meta(first_row_id_start, commit_entries)
 
+        # Conflict detection: read base entries from latest snapshot, then 
check conflicts
+        if detect_conflicts and latest_snapshot is not None:
+            base_entries = 
self.commit_scanner.read_all_entries_from_changed_partitions(
+                latest_snapshot, commit_entries)
+            conflict_exception = self.conflict_detection.check_conflicts(
+                latest_snapshot, base_entries, commit_entries, commit_kind)
+
+            if conflict_exception is not None:
+                if allow_rollback and self.rollback is not None:
+                    if self.rollback.try_to_rollback(latest_snapshot):
+                        return RetryResult(latest_snapshot, conflict_exception)

Review Comment:
   Should not return latest_snapshot to retry.



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