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


##########
paimon-core/src/main/java/org/apache/paimon/utils/SnapshotManager.java:
##########
@@ -382,8 +382,8 @@ public long repairEarliestSnapshot(long snapshotId) {
                 earliest = mid + 1; // Search in the right half
                 finalSnapshot = snapshot;
             } else {
-                finalSnapshot = snapshot; // Found the exact match
-                break;
+                finalSnapshot = snapshot;
+                earliest = mid + 1;

Review Comment:
   [P2] Refresh the upper bound before searching past an exact match
   
   `latest` is only an ID captured before the search. A concurrent rollback can 
update the latest hint and delete that snapshot after `latestSnapshotId()` 
returns. With snapshots 0/1/2 sharing this timestamp, if rollback removes 
snapshot 2 after we capture it, the first probe hits snapshot 1; this new 
continuation then probes snapshot 2 and throws `Snapshot file ... does not 
exist`, although snapshot 1 is still the correct answer. The old `break` 
returned snapshot 1.
   
   Please resolve the upper boundary through the existing live-snapshot path 
(for example, `latestSnapshot()` plus an early boundary return) and add a 
rollback-race regression test.



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