You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dr...@apache.org on 2016/04/26 05:07:36 UTC

lucene-solr:branch_6x: SOLR-9029: fix rare ZkStateReader visibility race during collection state format update

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 26ccf25a4 -> 89857653c


SOLR-9029: fix rare ZkStateReader visibility race during collection state format update


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

Branch: refs/heads/branch_6x
Commit: 89857653cafdafe5396abe946cc3d7f4fec1377d
Parents: 26ccf25
Author: Scott Blum <dr...@apache.org>
Authored: Mon Apr 25 21:15:02 2016 -0400
Committer: Scott Blum <dr...@apache.org>
Committed: Mon Apr 25 21:21:02 2016 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                            | 2 ++
 .../java/org/apache/solr/common/cloud/ZkStateReader.java    | 9 +++------
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/89857653/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index dcc7854..32a8e5b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -112,6 +112,8 @@ Bug Fixes
 
 * SOLR-8971: Preserve root cause when wrapping exceptions (hossman)
 
+* SOLR-9029: fix rare ZkStateReader visibility race during collection state format update (Scott Blum, hossman)
+
 Optimizations
 ----------------------
 * SOLR-8722: Don't force a full ZkStateReader refresh on every Overseer operation.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/89857653/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index c6f88c0..75cba6d 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -263,9 +263,9 @@ public class ZkStateReader implements Closeable {
       }
 
       ClusterState.CollectionRef ref = clusterState.getCollectionRef(collection);
-      if (ref == null) {
-        // We don't know anything about this collection, maybe it's new?
-        // First try to update the legacy cluster state.
+      if (ref == null || legacyCollectionStates.containsKey(collection)) {
+        // We either don't know anything about this collection (maybe it's new?) or it's legacy.
+        // First update the legacy cluster state.
         refreshLegacyClusterState(null);
         if (!legacyCollectionStates.containsKey(collection)) {
           // No dice, see if a new collection just got created.
@@ -283,9 +283,6 @@ public class ZkStateReader implements Closeable {
         }
         // Edge case: if there's no external collection, try refreshing legacy cluster state in case it's there.
         refreshLegacyClusterState(null);
-      } else if (legacyCollectionStates.containsKey(collection)) {
-        // Exists, and lives in legacy cluster state, force a refresh.
-        refreshLegacyClusterState(null);
       } else if (watchedCollectionStates.containsKey(collection)) {
         // Exists as a watched collection, force a refresh.
         DocCollection newState = fetchCollectionState(collection, null);