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


##########
paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java:
##########
@@ -423,6 +423,64 @@ public void testLaterOrEqualTimeMills() throws IOException 
{
         assertThat(snapshotManager.laterOrEqualTimeMills(millis + 
10001)).isNull();
     }
 
+    @Test
+    public void testEarlierOrEqualTimeMillsWithDuplicateCommitTimes() throws 
IOException {
+        long millis = 1684726826L;
+        FileIO localFileIO = LocalFileIO.create();
+        SnapshotManager snapshotManager =
+                newSnapshotManager(localFileIO, new Path(tempDir.toString()));
+        for (long i = 0; i < 3; i++) {
+            Snapshot snapshot = createSnapshotWithMillis(i, millis);
+            localFileIO.tryToWriteAtomic(snapshotManager.snapshotPath(i), 
snapshot.toJson());
+        }
+
+        
assertThat(snapshotManager.earlierOrEqualTimeMills(millis).id()).isEqualTo(2);

Review Comment:
   Thanks @JingsongLi! updated both paths to restart with refreshed snapshot 
boundaries when concurrent rollback or expiration removes a snapshot during the 
search 



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