Author: chetanm
Date: Fri Sep 22 06:12:33 2017
New Revision: 1809259
URL: http://svn.apache.org/viewvc?rev=1809259&view=rev
Log:
OAK-6635 - IndexReader closed exception in DocumentQueue
Merge the testcase with commits 1809253,1809255,1809256
Added:
jackrabbit/oak/branches/1.6/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java
- copied, changed from r1809255,
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java
Modified:
jackrabbit/oak/branches/1.6/ (props changed)
Propchange: jackrabbit/oak/branches/1.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 22 06:12:33 2017
@@ -1,3 +1,3 @@
/jackrabbit/oak/branches/1.0:1665962
-/jackrabbit/oak/trunk:1781068,1781075,1781248,1781386,1781846,1781907,1782000,1782029,1782196,1782447,1782476,1782770,1782945,1782966,1782973,1782990,1783061,1783066,1783089,1783104-1783105,1783110,1783619,1783720,1783731,1783733,1783738,1783742,1783773,1783855,1783891,1784023,1784034,1784130,1784162,1784251,1784401,1784551,1784574,1784689,1785095,1785108,1785283,1785838,1785917,1785919,1785946,1786122,1787074,1787145,1787217,1787425,1788056,1788378,1788387-1788389,1788463,1788476,1788850,1789056,1789534,1790382,1792049,1792463,1792742,1792746,1793013,1793088,1793618,1793627,1793644,1794393,1794417,1794683,1795138,1795314,1795330,1795475,1795488,1795491,1795502,1795594,1795613,1795618,1796144,1796230,1796239,1796274,1796278,1796988,1798035,1798834,1799219,1799389,1799393,1799924,1800269,1800606,1800613,1800974,1801011,1801013,1801118-1801119,1801675,1802260,1802262,1802286,1802548,1802934,1802938,1802973,1803026,1803247-1803249,1803951,1803953-1803955,1805851-1805852,1806668,1807308
,1807688,1808125,1808128,1808142,1808240,1808246,1809024,1809026,1809131
+/jackrabbit/oak/trunk:1781068,1781075,1781248,1781386,1781846,1781907,1782000,1782029,1782196,1782447,1782476,1782770,1782945,1782966,1782973,1782990,1783061,1783066,1783089,1783104-1783105,1783110,1783619,1783720,1783731,1783733,1783738,1783742,1783773,1783855,1783891,1784023,1784034,1784130,1784162,1784251,1784401,1784551,1784574,1784689,1785095,1785108,1785283,1785838,1785917,1785919,1785946,1786122,1787074,1787145,1787217,1787425,1788056,1788378,1788387-1788389,1788463,1788476,1788850,1789056,1789534,1790382,1792049,1792463,1792742,1792746,1793013,1793088,1793618,1793627,1793644,1794393,1794417,1794683,1795138,1795314,1795330,1795475,1795488,1795491,1795502,1795594,1795613,1795618,1796144,1796230,1796239,1796274,1796278,1796988,1798035,1798834,1799219,1799389,1799393,1799924,1800269,1800606,1800613,1800974,1801011,1801013,1801118-1801119,1801675,1802260,1802262,1802286,1802548,1802934,1802938,1802973,1803026,1803247-1803249,1803951,1803953-1803955,1805851-1805852,1806668,1807308
,1807688,1808125,1808128,1808142,1808240,1808246,1809024,1809026,1809131,1809253,1809255-1809256
/jackrabbit/trunk:1345480
Copied:
jackrabbit/oak/branches/1.6/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java
(from r1809255,
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java)
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.6/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java?p2=jackrabbit/oak/branches/1.6/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java&p1=jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java&r1=1809255&r2=1809259&rev=1809259&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java
(original)
+++
jackrabbit/oak/branches/1.6/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java
Fri Sep 22 06:12:33 2017
@@ -25,12 +25,14 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import com.google.common.collect.ImmutableMap;
import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier;
import org.apache.jackrabbit.oak.plugins.index.lucene.IndexNode;
import org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker;
@@ -51,8 +53,8 @@ import org.junit.rules.TemporaryFolder;
import static com.google.common.collect.ImmutableMap.of;
import static
com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static java.util.Collections.singletonList;
-import static org.apache.jackrabbit.oak.InitialContent.INITIAL_CONTENT;
import static
org.apache.jackrabbit.oak.plugins.index.lucene.FieldFactory.newPathField;
+import static
org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.INITIAL_CONTENT;
import static
org.apache.jackrabbit.oak.spi.mount.Mounts.defaultMountInfoProvider;
import static org.junit.Assert.fail;
@@ -70,6 +72,7 @@ public class ReaderRefCountIT {
indexCopier = new IndexCopier(sameThreadExecutor(),
temporaryFolder.getRoot());
}
+ @Ignore("OAK-6635")
@Test
public void syncIndex() throws Exception{
IndexDefinitionBuilder idx = new IndexDefinitionBuilder();
@@ -98,17 +101,17 @@ public class ReaderRefCountIT {
builder.child("oak:index").setChildNode("fooIndex", defnb.build());
NodeState repoState = builder.getNodeState();
- String indexPath = "/oak:index/fooIndex";
+ final String indexPath = "/oak:index/fooIndex";
- AtomicBoolean stop = new AtomicBoolean();
- List<Throwable> exceptionList = new CopyOnWriteArrayList<>();
+ final AtomicBoolean stop = new AtomicBoolean();
+ final List<Throwable> exceptionList = new CopyOnWriteArrayList<>();
- IndexTracker tracker = new IndexTracker(new
DefaultIndexReaderFactory(defaultMountInfoProvider(), indexCopier), nrtFactory);
+ final IndexTracker tracker = new IndexTracker(new
DefaultIndexReaderFactory(defaultMountInfoProvider(), indexCopier), nrtFactory);
tracker.update(repoState);
- DocumentQueue queue = new DocumentQueue(100, tracker,
sameThreadExecutor());
+ final DocumentQueue queue = new DocumentQueue(100, tracker,
sameThreadExecutor());
- CountDownLatch errorLatch = new CountDownLatch(1);
+ final CountDownLatch errorLatch = new CountDownLatch(1);
//Writer should try to refresh same IndexNode within same lock
//i.e. simulate a scenario where DocumentQueue pushes multiple
//sync index docs in same commit
@@ -119,7 +122,7 @@ public class ReaderRefCountIT {
Document d1 = new Document();
d1.add(newPathField("/a/b"));
LuceneDoc lcDoc = LuceneDoc.forUpdate(indexPath, "/a", d1);
- queue.addAllSynchronously(of(indexPath,
singletonList(lcDoc)));
+ queue.addAllSynchronously(ImmutableMap.<String,
Collection<LuceneDoc>>of(indexPath, singletonList(lcDoc)));
}
}
};