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/11/08 16:55:23 UTC

(jackrabbit-oak) branch OAK-10542-fix created (now 0d6d7552c7)

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

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


      at 0d6d7552c7 OAK-10542 : getLiveRevision must inspect split docs if local deleted does not contain most recent committed revision

This branch includes the following new commits:

     new 0d6d7552c7 OAK-10542 : getLiveRevision must inspect split docs if local deleted does not contain most recent committed revision

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-10542 : getLiveRevision must inspect split docs if local deleted does not contain most recent committed revision

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

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

commit 0d6d7552c73f6677514b00fa7cf3e46f518414a4
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Nov 8 17:55:09 2023 +0100

    OAK-10542 : getLiveRevision must inspect split docs if local deleted does not contain most recent committed revision
---
 .../jackrabbit/oak/plugins/document/NodeDocument.java  | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
index c79c6adfc4..a7c06a34d7 100644
--- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
+++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
@@ -1067,8 +1067,24 @@ public final class NodeDocument extends Document {
                                     RevisionVector readRevision,
                                     Map<Revision, String> validRevisions,
                                     LastRevs lastRevs) {
+        final SortedMap<Revision, String> local = getLocalDeleted();
         // check local deleted map first
-        Value value = getLatestValue(context, getLocalDeleted().entrySet(), readRevision, validRevisions, lastRevs);
+        Value value = getLatestValue(context, local.entrySet(), readRevision, validRevisions, lastRevs);
+        // check if there may be more recent values in a previous document
+        if (value != null
+                && !getPreviousRanges().isEmpty()
+                && !isMostRecentCommitted(local, value.revision, context)) {
+            // not reading the most recent value, we may need to
+            // consider previous documents as well
+            for (Revision prev : getPreviousRanges().keySet()) {
+                if (prev.compareRevisionTimeThenClusterId(value.revision) > 0) {
+                    // a previous document has more recent changes
+                    // than value.revision
+                    value = null;
+                    break;
+                }
+            }
+        }
         if (value == null && !getPreviousRanges().isEmpty()) {
             // need to check complete map
             value = getLatestValue(context, getDeleted().entrySet(), readRevision, validRevisions, lastRevs);