Author: mreutegg
Date: Wed Jul 20 10:40:08 2016
New Revision: 1753481

URL: http://svn.apache.org/viewvc?rev=1753481&view=rev
Log:
OAK-4518: ConcurrentAddReferenceTest fails occasionally

Remove docChildrenCache and enable test

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractJournalTest.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentReadAndAddTest.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCDeletionTest.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/JournalIT.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
 Wed Jul 20 10:40:08 2016
@@ -494,7 +494,6 @@ public class DocumentMK {
         public static final int DEFAULT_PREV_DOC_CACHE_PERCENTAGE = 4;
         public static final int DEFAULT_CHILDREN_CACHE_PERCENTAGE = 10;
         public static final int DEFAULT_DIFF_CACHE_PERCENTAGE = 5;
-        public static final int DEFAULT_DOC_CHILDREN_CACHE_PERCENTAGE = 3;
         public static final int DEFAULT_CACHE_SEGMENT_COUNT = 16;
         public static final int DEFAULT_CACHE_STACK_MOVE_DISTANCE = 16;
         private DocumentNodeStore nodeStore;
@@ -514,7 +513,6 @@ public class DocumentMK {
         private int prevDocCachePercentage = DEFAULT_PREV_DOC_CACHE_PERCENTAGE;
         private int childrenCachePercentage = 
DEFAULT_CHILDREN_CACHE_PERCENTAGE;
         private int diffCachePercentage = DEFAULT_DIFF_CACHE_PERCENTAGE;
-        private int docChildrenCachePercentage = 
DEFAULT_DOC_CHILDREN_CACHE_PERCENTAGE;
         private int cacheSegmentCount = DEFAULT_CACHE_SEGMENT_COUNT;
         private int cacheStackMoveDistance = DEFAULT_CACHE_STACK_MOVE_DISTANCE;
         private boolean useSimpleRevision;
@@ -829,19 +827,16 @@ public class DocumentMK {
         public Builder memoryCacheDistribution(int nodeCachePercentage,
                                                int prevDocCachePercentage,
                                                int childrenCachePercentage,
-                                               int docChildrenCachePercentage,
                                                int diffCachePercentage) {
             checkArgument(nodeCachePercentage >= 0);
             checkArgument(prevDocCachePercentage >= 0);
             checkArgument(childrenCachePercentage>= 0);
-            checkArgument(docChildrenCachePercentage >= 0);
             checkArgument(diffCachePercentage >= 0);
             checkArgument(nodeCachePercentage + prevDocCachePercentage + 
childrenCachePercentage +
-                    docChildrenCachePercentage + diffCachePercentage < 100);
+                    diffCachePercentage < 100);
             this.nodeCachePercentage = nodeCachePercentage;
             this.prevDocCachePercentage = prevDocCachePercentage;
             this.childrenCachePercentage = childrenCachePercentage;
-            this.docChildrenCachePercentage = docChildrenCachePercentage;
             this.diffCachePercentage = diffCachePercentage;
             return this;
         }
@@ -860,11 +855,7 @@ public class DocumentMK {
 
         public long getDocumentCacheSize() {
             return memoryCacheSize - getNodeCacheSize() - 
getPrevDocumentCacheSize() - getChildrenCacheSize()
-                    - getDiffCacheSize() - getDocChildrenCacheSize();
-        }
-
-        public long getDocChildrenCacheSize() {
-            return memoryCacheSize * docChildrenCachePercentage / 100;
+                    - getDiffCacheSize();
         }
 
         public long getDiffCacheSize() {
@@ -1024,10 +1015,6 @@ public class DocumentMK {
             return buildCache(CacheType.CHILDREN, getChildrenCacheSize(), 
null, null);
         }
 
-        public Cache<StringValue, NodeDocument.Children> 
buildDocChildrenCache() {
-            return buildCache(CacheType.DOC_CHILDREN, 
getDocChildrenCacheSize(), null, null);
-        }
-
         public Cache<PathRev, StringValue> buildMemoryDiffCache() {
             return buildCache(CacheType.DIFF, getMemoryDiffCacheSize(), null, 
null);
         }

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
 Wed Jul 20 10:40:08 2016
@@ -34,7 +34,6 @@ import static org.apache.jackrabbit.oak.
 import static 
org.apache.jackrabbit.oak.plugins.document.JournalEntry.fillExternalChanges;
 import static org.apache.jackrabbit.oak.plugins.document.UpdateOp.Key;
 import static org.apache.jackrabbit.oak.plugins.document.UpdateOp.Operation;
-import static 
org.apache.jackrabbit.oak.plugins.document.util.Utils.asStringValueIterable;
 import static 
org.apache.jackrabbit.oak.plugins.document.util.Utils.getIdFromPath;
 import static org.apache.jackrabbit.oak.plugins.document.util.Utils.pathToId;
 
@@ -49,7 +48,6 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.NavigableSet;
 import java.util.Set;
 import java.util.TimeZone;
 import java.util.concurrent.Callable;
@@ -71,11 +69,9 @@ import javax.management.openmbean.Compos
 
 import com.google.common.base.Function;
 import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
 import com.google.common.base.Supplier;
 import com.google.common.base.Suppliers;
 import com.google.common.cache.Cache;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.UncheckedExecutionException;
@@ -101,7 +97,6 @@ import org.apache.jackrabbit.oak.commons
 import org.apache.jackrabbit.oak.json.BlobSerializer;
 import 
org.apache.jackrabbit.oak.plugins.document.util.LeaseCheckDocumentStoreWrapper;
 import 
org.apache.jackrabbit.oak.plugins.document.util.LoggingDocumentStoreWrapper;
-import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
 import 
org.apache.jackrabbit.oak.plugins.document.util.TimingDocumentStoreWrapper;
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
 import org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore;
@@ -318,14 +313,6 @@ public final class DocumentNodeStore
     private final CacheStats nodeChildrenCacheStats;
 
     /**
-     * Child doc cache.
-     *
-     * Key: StringValue, value: Children
-     */
-    private final Cache<StringValue, NodeDocument.Children> docChildrenCache;
-    private final CacheStats docChildrenCacheStats;
-
-    /**
      * The change log to keep track of commits for diff operations.
      */
     private final DiffCache diffCache;
@@ -495,10 +482,6 @@ public final class DocumentNodeStore
         nodeChildrenCacheStats = new CacheStats(nodeChildrenCache, 
"Document-NodeChildren",
                 builder.getWeigher(), builder.getChildrenCacheSize());
 
-        docChildrenCache = builder.buildDocChildrenCache();
-        docChildrenCacheStats = new CacheStats(docChildrenCache, 
"Document-DocChildren",
-                builder.getWeigher(), builder.getDocChildrenCacheSize());
-
         diffCache = builder.getDiffCache();
         checkpoints = new Checkpoints(this);
 
@@ -822,10 +805,6 @@ public final class DocumentNodeStore
         return nodeChildrenCacheStats;
     }
 
-    public CacheStats getDocChildrenCacheStats() {
-        return docChildrenCacheStats;
-    }
-
     @Nonnull
     public Iterable<CacheStats> getDiffCacheStats() {
         return diffCache.getStats();
@@ -841,10 +820,6 @@ public final class DocumentNodeStore
         return changes;
     }
 
-    void invalidateDocChildrenCache() {
-        docChildrenCache.invalidateAll();
-    }
-
     void invalidateNodeChildrenCache() {
         nodeChildrenCache.invalidateAll();
     }
@@ -940,6 +915,7 @@ public final class DocumentNodeStore
         }
     }
 
+    @Nonnull
     DocumentNodeState.Children getChildren(@Nonnull final 
AbstractDocumentNodeState parent,
                               @Nullable final String name,
                               final int limit)
@@ -1062,71 +1038,7 @@ public final class DocumentNodeStore
         } else {
             from = Utils.getKeyLowerLimit(path);
         }
-        if (name != null || limit > NUM_CHILDREN_CACHE_LIMIT) {
-            // do not use cache when there is a lower bound name
-            // or more than 16k child docs are requested
-            return store.query(Collection.NODES, from, to, limit);
-        }
-        final StringValue key = new StringValue(path);
-        // check cache
-        NodeDocument.Children c = docChildrenCache.getIfPresent(key);
-        if (c == null) {
-            c = new NodeDocument.Children();
-            List<NodeDocument> docs = store.query(Collection.NODES, from, to, 
limit);
-            for (NodeDocument doc : docs) {
-                String p = doc.getPath();
-                c.childNames.add(PathUtils.getName(p));
-            }
-            c.isComplete = docs.size() < limit;
-            docChildrenCache.put(key, c);
-            return docs;
-        } else if (c.childNames.size() < limit && !c.isComplete) {
-            // fetch more and update cache
-            String lastName = c.childNames.get(c.childNames.size() - 1);
-            String lastPath = concat(path, lastName);
-            String low = Utils.getIdFromPath(lastPath);
-            int remainingLimit = limit - c.childNames.size();
-            List<NodeDocument> docs = store.query(Collection.NODES,
-                    low, to, remainingLimit);
-            NodeDocument.Children clone = c.clone();
-            for (NodeDocument doc : docs) {
-                String p = doc.getPath();
-                clone.childNames.add(PathUtils.getName(p));
-            }
-            clone.isComplete = docs.size() < remainingLimit;
-            docChildrenCache.put(key, clone);
-            c = clone;
-        }
-        Iterable<NodeDocument> head = filter(transform(c.childNames,
-                new Function<String, NodeDocument>() {
-            @Override
-            public NodeDocument apply(String name) {
-                String p = concat(path, name);
-                NodeDocument doc = store.find(Collection.NODES, 
Utils.getIdFromPath(p));
-                if (doc == null) {
-                    docChildrenCache.invalidate(key);
-                }
-                return doc;
-            }
-        }), Predicates.notNull());
-        Iterable<NodeDocument> it;
-        if (c.isComplete) {
-            it = head;
-        } else {
-            // OAK-2420: 'head' may have null documents when documents are
-            // concurrently removed from the store. concat 'tail' to fetch
-            // more documents if necessary
-            final String last = getIdFromPath(concat(
-                    path, c.childNames.get(c.childNames.size() - 1)));
-            Iterable<NodeDocument> tail = new Iterable<NodeDocument>() {
-                @Override
-                public Iterator<NodeDocument> iterator() {
-                    return store.query(NODES, last, to, limit).iterator();
-                }
-            };
-            it = Iterables.concat(head, tail);
-        }
-        return Iterables.limit(it, limit);
+        return store.query(Collection.NODES, from, to, limit);
     }
 
     /**
@@ -1293,41 +1205,6 @@ public final class DocumentNodeStore
             w.tag('^').key(PathUtils.getName(p)).object().endObject();
         }
         cacheEntry.append(path, w.toString());
-
-        // update docChildrenCache
-        if (!added.isEmpty()) {
-            StringValue docChildrenKey = new StringValue(path);
-            NodeDocument.Children docChildren = 
docChildrenCache.getIfPresent(docChildrenKey);
-            if (docChildren != null) {
-                int currentSize = docChildren.childNames.size();
-                NavigableSet<String> names = 
Sets.newTreeSet(docChildren.childNames);
-                // incomplete cache entries must not be updated with
-                // names at the end of the list because there might be
-                // a next name in DocumentStore smaller than the one added
-                if (!docChildren.isComplete) {
-                    for (String childPath : added) {
-                        String name = PathUtils.getName(childPath);
-                        if (names.higher(name) != null) {
-                            names.add(Utils.unshareString(name));
-                        }
-                    }
-                } else {
-                    // add all
-                    for (String childPath : added) {
-                        
names.add(Utils.unshareString(PathUtils.getName(childPath)));
-                    }
-                }
-                // any changes?
-                if (names.size() != currentSize) {
-                    // create new cache entry with updated names
-                    boolean complete = docChildren.isComplete;
-                    docChildren = new NodeDocument.Children();
-                    docChildren.isComplete = complete;
-                    docChildren.childNames.addAll(names);
-                    docChildrenCache.put(docChildrenKey, docChildren);
-                }
-            }
-        }
     }
 
     /**
@@ -2015,34 +1892,14 @@ public final class DocumentNodeStore
                 if (externalSort == null) {
                     // if no externalSort available, then invalidate the 
classic way: everything
                     stats.cacheStats = store.invalidateCache();
-                    docChildrenCache.invalidateAll();
                 } else {
                     try {
                         externalSort.sort();
                         stats.numExternalChanges = externalSort.getSize();
                         stats.cacheStats = 
store.invalidateCache(pathToId(externalSort));
-                        // OAK-3002: only invalidate affected items (using 
journal)
-                        long origSize = docChildrenCache.size();
-                        if (origSize == 0) {
-                            // if docChildrenCache is empty, don't bother
-                            // calling invalidateAll either way
-                            // (esp calling invalidateAll(Iterable) will
-                            // potentially iterate over all keys even though
-                            // there's nothing to be deleted)
-                            LOG.trace("backgroundRead: docChildrenCache 
nothing to invalidate");
-                        } else {
-                            // however, if the docChildrenCache is not empty,
-                            // use the invalidateAll(Iterable) variant,
-                            // passing it a Iterable<StringValue>, as that's
-                            // what is contained in the cache
-                            
docChildrenCache.invalidateAll(asStringValueIterable(externalSort));
-                            long newSize = docChildrenCache.size();
-                            LOG.trace("backgroundRead: docChildrenCache 
invalidation result: orig: {}, new: {} ", origSize, newSize);
-                        }
                     } catch (Exception ioe) {
                         LOG.error("backgroundRead: got IOException during 
external sorting/cache invalidation (as a result, invalidating entire cache): 
"+ioe, ioe);
                         stats.cacheStats = store.invalidateCache();
-                        docChildrenCache.invalidateAll();
                     }
                 }
                 stats.cacheInvalidationTime = clock.getTime() - time;

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
 Wed Jul 20 10:40:08 2016
@@ -25,7 +25,6 @@ import static org.apache.jackrabbit.oak.
 import static 
org.apache.jackrabbit.oak.osgi.OsgiUtil.lookupFrameworkThenConfiguration;
 import static 
org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_CHILDREN_CACHE_PERCENTAGE;
 import static 
org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_DIFF_CACHE_PERCENTAGE;
-import static 
org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_DOC_CHILDREN_CACHE_PERCENTAGE;
 import static 
org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_NODE_CACHE_PERCENTAGE;
 import static 
org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_PREV_DOC_CACHE_PERCENTAGE;
 import static 
org.apache.jackrabbit.oak.spi.blob.osgi.SplitBlobStoreService.ONLY_STANDALONE_TARGET;
@@ -178,12 +177,6 @@ public class DocumentNodeStoreService {
     )
     private static final String PROP_DIFF_CACHE_PERCENTAGE = 
"diffCachePercentage";
     
-    @Property(intValue = 
DocumentMK.Builder.DEFAULT_DOC_CHILDREN_CACHE_PERCENTAGE,
-            label = "Document Children Cache",
-            description = "Percentage of cache to be allocated towards 
Document children cache"
-    )
-    private static final String PROP_DOC_CHILDREN_CACHE_PERCENTAGE = 
"docChildrenCachePercentage";
-
     @Property(intValue = DocumentMK.Builder.DEFAULT_CACHE_SEGMENT_COUNT,
             label = "LIRS Cache Segment Count",
             description = "The number of segments in the LIRS cache " + 
@@ -413,7 +406,6 @@ public class DocumentNodeStoreService {
         int nodeCachePercentage = toInteger(prop(PROP_NODE_CACHE_PERCENTAGE), 
DEFAULT_NODE_CACHE_PERCENTAGE);
         int prevDocCachePercentage = 
toInteger(prop(PROP_PREV_DOC_CACHE_PERCENTAGE), DEFAULT_NODE_CACHE_PERCENTAGE);
         int childrenCachePercentage = 
toInteger(prop(PROP_CHILDREN_CACHE_PERCENTAGE), 
DEFAULT_CHILDREN_CACHE_PERCENTAGE);
-        int docChildrenCachePercentage = 
toInteger(prop(PROP_DOC_CHILDREN_CACHE_PERCENTAGE), 
DEFAULT_DOC_CHILDREN_CACHE_PERCENTAGE);
         int diffCachePercentage = toInteger(prop(PROP_DIFF_CACHE_PERCENTAGE), 
DEFAULT_DIFF_CACHE_PERCENTAGE);
         int blobCacheSize = toInteger(prop(PROP_BLOB_CACHE_SIZE), 
DEFAULT_BLOB_CACHE_SIZE);
         String persistentCache = 
PropertiesUtil.toString(prop(PROP_PERSISTENT_CACHE), DEFAULT_PERSISTENT_CACHE);
@@ -427,7 +419,6 @@ public class DocumentNodeStoreService {
                         nodeCachePercentage,
                         prevDocCachePercentage,
                         childrenCachePercentage, 
-                        docChildrenCachePercentage, 
                         diffCachePercentage).
                 setCacheSegmentCount(cacheSegmentCount).
                 setCacheStackMoveDistance(cacheStackMoveDistance).
@@ -711,13 +702,6 @@ public class DocumentNodeStoreService {
                         CacheStatsMBean.TYPE,
                         store.getNodeChildrenCacheStats().getName())
         );
-        registrations.add(
-                registerMBean(whiteboard,
-                        CacheStatsMBean.class,
-                        store.getDocChildrenCacheStats(),
-                        CacheStatsMBean.TYPE,
-                        store.getDocChildrenCacheStats().getName())
-        );
         for (CacheStats cs : store.getDiffCacheStats()) {
             registrations.add(
                     registerMBean(whiteboard,

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
 Wed Jul 20 10:40:08 2016
@@ -154,7 +154,6 @@ public class VersionGarbageCollector {
 
             gc.removeDocuments(stats);
 
-            nodeStore.invalidateDocChildrenCache();
             stats.deleteDeletedDocs.stop();
         } finally {
             gc.close();

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractJournalTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractJournalTest.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractJournalTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractJournalTest.java
 Wed Jul 20 10:40:08 2016
@@ -60,10 +60,6 @@ public abstract class AbstractJournalTes
         mks.clear();
     }
 
-    protected static void invalidateDocChildrenCache(DocumentNodeStore store) {
-        store.invalidateDocChildrenCache();
-    }
-
     protected static void renewClusterIdLease(DocumentNodeStore store) {
         store.renewClusterIdLease();
     }

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentReadAndAddTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentReadAndAddTest.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentReadAndAddTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentReadAndAddTest.java
 Wed Jul 20 10:40:08 2016
@@ -33,13 +33,11 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 
-@Ignore
 public class ConcurrentReadAndAddTest {
 
     @Rule

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCDeletionTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCDeletionTest.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCDeletionTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCDeletionTest.java
 Wed Jul 20 10:40:08 2016
@@ -272,14 +272,18 @@ public class VersionGCDeletionTest {
         final Semaphore queries = new Semaphore(0);
         final CountDownLatch ready = new CountDownLatch(1);
         MemoryDocumentStore ms = new MemoryDocumentStore() {
+            @Nonnull
             @Override
-            public <T extends Document> T find(Collection<T> collection,
-                                               String key) {
-                if (Thread.currentThread() != currentThread) {
+            public <T extends Document> List<T> query(Collection<T> collection,
+                                                      String fromKey,
+                                                      String toKey,
+                                                      int limit) {
+                if (collection == Collection.NODES
+                        && Thread.currentThread() != currentThread) {
                     ready.countDown();
                     queries.acquireUninterruptibly();
                 }
-                return super.find(collection, key);
+                return super.query(collection, fromKey, toKey, limit);
             }
         };
         store = new DocumentMK.Builder().clock(clock)
@@ -337,7 +341,7 @@ public class VersionGCDeletionTest {
         VersionGCStats stats = gc.gc(30, MINUTES);
         assertEquals(90, stats.deletedDocGCCount);
 
-        queries.release(200);
+        queries.release(2);
 
         List<String> names = f.get();
         assertEquals(expected, names);

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/JournalIT.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/JournalIT.java?rev=1753481&r1=1753480&r2=1753481&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/JournalIT.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/JournalIT.java
 Wed Jul 20 10:40:08 2016
@@ -42,7 +42,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
 public class JournalIT extends AbstractJournalTest {
 
@@ -69,8 +68,7 @@ public class JournalIT extends AbstractJ
         final DocumentNodeStore ns2 = createMK(2, 0).getNodeStore();
         LOG.info("cache size 1: " + 
getCacheElementCount(ns1.getDocumentStore()));
 
-        // invalidate both caches under test first
-        invalidateDocChildrenCache(ns1);
+        // invalidate cache under test first
         ns1.getDocumentStore().invalidateCache();
 
         {
@@ -164,8 +162,7 @@ public class JournalIT extends AbstractJ
         final DocumentNodeStore ns1 = createMK(1, 0).getNodeStore();
         final DocumentNodeStore ns2 = createMK(2, 0).getNodeStore();
 
-        // invalidate both caches under test first
-        invalidateDocChildrenCache(ns1);
+        // invalidate cache under test first
         ns1.getDocumentStore().invalidateCache();
 
         // first create child node in instance 1


Reply via email to