[ https://issues.apache.org/jira/browse/OAK-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13940505#comment-13940505 ]
Thomas Mueller commented on OAK-333: ------------------------------------ I think all negative cache entries with a long path need to be invalidated. That should be relatively simple to implement. Unit test: {noformat} Index: src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/CacheInvalidationIT.java =================================================================== --- src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/CacheInvalidationIT.java (revision 1579222) +++ src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/CacheInvalidationIT.java (working copy) @@ -41,6 +41,8 @@ import static org.apache.jackrabbit.oak.plugins.document.mongo.CacheInvalidator.InvalidationResult; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class CacheInvalidationIT extends AbstractMongoConnectionTest { @@ -135,6 +137,43 @@ } @Test + public void testCacheInvalidationHierarchicalNotExist() + throws CommitFailedException { + + NodeBuilder b2 = getRoot(c2).builder(); + // we create x/other, so that x is known to have a child node + b2.child("x").child("other"); + b2.child("y"); + c2.merge(b2, EmptyHook.INSTANCE, CommitInfo.EMPTY); + c2.runBackgroundOperations(); + c1.runBackgroundOperations(); + + // we check for the existence of "x/futureX", which + // should create a negative entry in the cache + NodeState x = getRoot(c1).getChildNode("x"); + assertTrue(x.exists()); + assertFalse(x.getChildNode("futureX").exists()); + // we don't check for the existence of "y/futureY" + NodeState y = getRoot(c1).getChildNode("y"); + assertTrue(y.exists()); + + // now we add both "futureX" and "futureY" + // in the other cluster node + b2.child("x").child("futureX").setProperty("z", "1"); + c2.merge(b2, EmptyHook.INSTANCE, CommitInfo.EMPTY); + b2.child("y").child("futureY").setProperty("z", "2"); + c2.merge(b2, EmptyHook.INSTANCE, CommitInfo.EMPTY); + + c2.runBackgroundOperations(); + c1.runBackgroundOperations(); + + // both nodes should now be visible + assertTrue(getRoot(c1).getChildNode("y").getChildNode("futureY").exists()); + assertTrue(getRoot(c1).getChildNode("x").getChildNode("futureX").exists()); + + } + + @Test public void testCacheInvalidationLinear() throws CommitFailedException { final int totalPaths = createScenario(); {noformat} > 1000 byte path limit in MongoMK > ------------------------------- > > Key: OAK-333 > URL: https://issues.apache.org/jira/browse/OAK-333 > Project: Jackrabbit Oak > Issue Type: Bug > Components: mongomk > Affects Versions: 0.5 > Reporter: Mete Atamel > Assignee: Thomas Mueller > Priority: Minor > Fix For: 0.19 > > Attachments: NodeNameLimitsTest.java, OAK-333.patch > > > In an infinite loop try to add nodes one under another to have N0/N1/N2...NN. > At some point, the current parent node will not be found and the current > commit will fail. I think this happens when the path length exceeds 1000 > characters. Is this enough for a path? I was able to create this way only 222 > levels in the tree (and my node names were really short N1, N2 ...) > There's an automated tests for this: NodeExistsCommandMongoTest.testTreeDepth -- This message was sent by Atlassian JIRA (v6.2#6252)