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 mr...@apache.org on 2021/02/16 14:26:41 UTC

svn commit: r1886595 - /jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java

Author: mreutegg
Date: Tue Feb 16 14:26:41 2021
New Revision: 1886595

URL: http://svn.apache.org/viewvc?rev=1886595&view=rev
Log:
OAK-9358: DocumentNodeStore may accumulate split candidates

Add ignored tests that reproduce the issue

Modified:
    jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java

Modified: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java?rev=1886595&r1=1886594&r2=1886595&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java (original)
+++ jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentSplitTest.java Tue Feb 16 14:26:41 2021
@@ -45,6 +45,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.stats.Clock;
 import org.jetbrains.annotations.NotNull;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.collect.Iterables;
@@ -63,6 +64,7 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.plugins.document.UpdateOp.Operation.Type.SET_MAP_ENTRY;
 import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isCommitted;
 import static org.apache.jackrabbit.oak.plugins.memory.BinaryPropertyState.binaryProperty;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.either;
 import static org.hamcrest.Matchers.empty;
 import static org.hamcrest.Matchers.hasSize;
@@ -72,7 +74,6 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -1074,6 +1075,32 @@ public class DocumentSplitTest extends B
         }
     }
 
+    @Ignore("OAK-9358")
+    @Test
+    public void splitCandidatesCleanAfterBackgroundUpdate() throws Exception {
+        DocumentNodeStore ns = mk.getNodeStore();
+        NodeBuilder builder = ns.getRoot().builder();
+        builder.child("foo");
+        merge(ns, builder);
+        // sneak in split candidate
+        ns.addSplitCandidate(Utils.getIdFromPath("/foo"));
+        ns.runBackgroundOperations();
+        assertThat(ns.getSplitCandidates(), empty());
+    }
+
+    @Ignore("OAK-9358")
+    @Test
+    public void splitCandidatesCleanAfterBackgroundUpdateWithUnknownId() throws Exception {
+        DocumentNodeStore ns = mk.getNodeStore();
+        NodeBuilder builder = ns.getRoot().builder();
+        builder.child("foo");
+        merge(ns, builder);
+        // sneak in unknown split candidate
+        ns.addSplitCandidate(Utils.getIdFromPath("/bar"));
+        ns.runBackgroundOperations();
+        assertThat(ns.getSplitCandidates(), empty());
+    }
+
     private static class TestRevisionContext implements RevisionContext {
 
         private final RevisionContext rc;