You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by st...@apache.org on 2023/08/28 17:24:30 UTC

[jackrabbit-oak] branch OAK-10199-setModified created (now e52e19eaef)

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

stefanegli pushed a change to branch OAK-10199-setModified
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


      at e52e19eaef OAK-10199 : update _modified when detail gc actually removes garbage

This branch includes the following new commits:

     new e52e19eaef OAK-10199 : update _modified when detail gc actually removes garbage

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[jackrabbit-oak] 01/01: OAK-10199 : update _modified when detail gc actually removes garbage

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e52e19eaef0ba80576e1b9194ad3b2fcd7325638
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Aug 28 19:24:08 2023 +0200

    OAK-10199 : update _modified when detail gc actually removes garbage
---
 .../jackrabbit/oak/plugins/document/VersionGarbageCollector.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
index a32ded6c5b..8822d62663 100644
--- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
+++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
@@ -825,6 +825,7 @@ public class VersionGarbageCollector {
         private final AtomicBoolean cancel;
         private final Stopwatch timer;
         private final List<UpdateOp> updateOpList;
+        private final Revision revisionForModified;
 
         private final Map<String, Integer> deletedPropsCountMap;
         private int garbageDocsCount;
@@ -837,6 +838,8 @@ public class VersionGarbageCollector {
             this.updateOpList = new ArrayList<>();
             this.deletedPropsCountMap = new HashMap<>();
             this.timer = createUnstarted();
+            // clusterId for revisionForModified is unused - hence set to 0 below:
+            this.revisionForModified = Revision.newRevision(0);
         }
 
         public void collectGarbage(final NodeDocument doc, final GCPhases phases) {
@@ -844,13 +847,14 @@ public class VersionGarbageCollector {
             monitor.info("Collecting Detailed Garbage for doc [{}]", doc.getId());
 
             final UpdateOp op = new UpdateOp(requireNonNull(doc.getId()), false);
-            op.equals(MODIFIED_IN_SECS, doc.getModified());
 
             collectDeletedProperties(doc, phases, op);
             collectUnmergedBranchCommitDocument(doc, phases, op);
             collectOldRevisions(doc, phases, op);
             // only add if there are changes for this doc
             if (op.hasChanges()) {
+                op.equals(MODIFIED_IN_SECS, doc.getModified());
+                NodeDocument.setModified(op, revisionForModified);
                 garbageDocsCount++;
                 totalGarbageDocsCount++;
                 monitor.info("Collected [{}] garbage for doc [{}]", op.getChanges().size(), doc.getId());