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:03 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/master 9128bdbaf -> ce22c2697


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/ce22c269
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ce22c269
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ce22c269

Branch: refs/heads/master
Commit: ce22c2697c1342fd670e3bac460a53aef90d1d80
Parents: 9128bdb
Author: markrmiller <ma...@apache.org>
Authored: Thu Oct 6 11:31:30 2016 -0400
Committer: markrmiller <ma...@apache.org>
Committed: Thu Oct 6 11:31:30 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/ce22c269/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index be205a4..b0b08e8 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,6 +156,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/ce22c269/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 e38f722..b9d9f51 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -436,11 +436,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;