This is an automated email from the ASF dual-hosted git repository.

daim pushed a commit to branch DetailedGC/OAK-10199
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 484d3dc04a61de5929b027ffe5f0a9dbe2fadca1
Author: Rishabh Kumar <[email protected]>
AuthorDate: Mon Jun 19 23:04:33 2023 +0530

    OAK-10199 : added check to include oldestId when running detailedGc very 
first time
---
 .../org/apache/jackrabbit/oak/plugins/document/VersionGCSupport.java | 1 +
 .../apache/jackrabbit/oak/plugins/document/VersionGCSupportTest.java | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupport.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupport.java
index df505adf8a..b76803ce23 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupport.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupport.java
@@ -83,6 +83,7 @@ public class VersionGCSupport {
      * since the epoch and the implementation will convert them to seconds at
      * the granularity of the {@link NodeDocument#MODIFIED_IN_SECS} field and
      * then perform the comparison.
+     * <p/>
      *
      *
      * @param fromModified the lower bound modified timestamp (inclusive)
diff --git 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupportTest.java
 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupportTest.java
index 565600a143..d0aac59200 100644
--- 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupportTest.java
+++ 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupportTest.java
@@ -236,6 +236,7 @@ public class VersionGCSupportTest {
             }
             oldestModifiedDocId = oldestModifiedDoc.getId();
             oldestModifiedDocTs = 
ofNullable(oldestModifiedDoc.getModified()).orElse(0L);
+            includeFromId = false;
         }
     }
 
@@ -271,6 +272,7 @@ public class VersionGCSupportTest {
             }
             oldestModifiedDocId = oldestModifiedDoc.getId();
             oldestModifiedDocTs = 
ofNullable(oldestModifiedDoc.getModified()).orElse(0L);
+            includeFromId = false;
         }
 
         // fetch last remaining document now
@@ -318,6 +320,7 @@ public class VersionGCSupportTest {
             }
             oldestModifiedDocId = oldestModifiedDoc.getId();
             oldestModifiedDocTs = 
ofNullable(oldestModifiedDoc.getModified()).orElse(0L);
+            includeFromId = false;
         }
 
         // all documents had been fetched, now we won't get any document
@@ -331,7 +334,7 @@ public class VersionGCSupportTest {
     }
 
     private void assertModified(long fromSeconds, long toSeconds, long num) {
-        Iterable<NodeDocument> docs = 
gcSupport.getModifiedDocs(SECONDS.toMillis(fromSeconds), 
SECONDS.toMillis(toSeconds), 10, MIN_ID_VALUE);
+        Iterable<NodeDocument> docs = 
gcSupport.getModifiedDocs(SECONDS.toMillis(fromSeconds), 
SECONDS.toMillis(toSeconds), 10, MIN_ID_VALUE, false);
         assertEquals(num, stream(docs.spliterator(), false).count());
         assertTrue(isInOrder(docs, (o1, o2) -> 
comparing(NodeDocument::getModified).thenComparing(Document::getId).compare(o1, 
o2)));
     }

Reply via email to