You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2016/10/06 15:47:48 UTC

lucene-solr:branch_6x: SOLR-9470: Index replication interactions with IndexWriter can cause deadlock.

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 739c0a7bf -> 82440f307


SOLR-9470: Index replication interactions with IndexWriter can cause deadlock.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/82440f30
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/82440f30
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/82440f30

Branch: refs/heads/branch_6x
Commit: 82440f307a211d8f05fe729ec1361bcd1abd0e4e
Parents: 739c0a7
Author: markrmiller <ma...@apache.org>
Authored: Thu Oct 6 11:31:30 2016 -0400
Committer: markrmiller <ma...@apache.org>
Committed: Thu Oct 6 11:47:31 2016 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                             | 2 ++
 solr/core/src/java/org/apache/solr/handler/IndexFetcher.java | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/82440f30/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e6a1491..cfa2571 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -125,6 +125,8 @@ Bug Fixes
   at a node before its local state had updated with the new collection data
   (Alan Woodward)
 
+* SOLR-9470: Index replication interactions with IndexWriter can cause deadlock. (Xunlong via Mark Miller)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/82440f30/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
index c66b3ab..763bdc1 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -422,11 +422,15 @@ public class IndexFetcher {
           } finally {
             writer.decref();
           }
-          solrCore.getUpdateHandler().getSolrCoreState().closeIndexWriter(solrCore, true);
         }
         boolean reloadCore = false;
 
         try {
+          // we have to be careful and do this after we know isFullCopyNeeded won't be flipped
+          if (!isFullCopyNeeded) {
+            solrCore.getUpdateHandler().getSolrCoreState().closeIndexWriter(solrCore, true);
+          }
+
           LOG.info("Starting download (fullCopy={}) to {}", isFullCopyNeeded, tmpIndexDir);
           successfulInstall = false;