You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2013/09/17 04:14:51 UTC

svn commit: r1523871 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/core/CoreContainer.java

Author: yonik
Date: Tue Sep 17 02:14:50 2013
New Revision: 1523871

URL: http://svn.apache.org/r1523871
Log:
SOLR-5240: unlimited core loading threads to fix waiting-for-other-replicas deadlock

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1523871&r1=1523870&r2=1523871&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Tue Sep 17 02:14:50 2013
@@ -267,6 +267,11 @@ Bug Fixes
 
 * SOLR-5150: HdfsIndexInput may not fully read requested bytes. (Mark Miller, Patrick Hunt)
 
+* SOLR-5240: All solr cores will now be loaded in parallel (as opposed to a fixed number)
+  in zookeeper mode to avoid deadlocks due to replicas waiting for other replicas
+  to come up. (yonik)
+
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java?rev=1523871&r1=1523870&r2=1523871&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java Tue Sep 17 02:14:50 2013
@@ -57,6 +57,9 @@ import java.util.concurrent.ExecutorComp
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
@@ -209,8 +212,10 @@ public class CoreContainer {
     containerProperties = cfg.getSolrProperties("solr");
 
     // setup executor to load cores in parallel
-    ExecutorService coreLoadExecutor = Executors.newFixedThreadPool(cfg.getCoreLoadThreadCount(),
-        new DefaultSolrThreadFactory("coreLoadExecutor"));
+    // do not limit the size of the executor in zk mode since cores may try and wait for each other.
+    ExecutorService coreLoadExecutor = Executors.newFixedThreadPool(
+        ( zkSys.getZkController() == null ? cfg.getCoreLoadThreadCount() : Integer.MAX_VALUE ),
+        new DefaultSolrThreadFactory("coreLoadExecutor") );
 
     try {
       CompletionService<SolrCore> completionService = new ExecutorCompletionService<SolrCore>(