You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2015/01/12 23:56:31 UTC

svn commit: r1651223 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/cloud/OverseerAutoReplicaFailoverThread.java

Author: anshum
Date: Mon Jan 12 22:56:31 2015
New Revision: 1651223

URL: http://svn.apache.org/r1651223
Log:
SOLR-6923: AutoAddReplicas also consults live_nodes to see if a state change has happened (merge from trunk)

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/OverseerAutoReplicaFailoverThread.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1651223&r1=1651222&r2=1651223&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Mon Jan 12 22:56:31 2015
@@ -385,6 +385,9 @@ Bug Fixes
 * SOLR-6946: Document -p port option for the create_core and create_collection actions in
   bin/solr (Timothy Potter)
 
+* SOLR-6923: AutoAddReplicas also consults live_nodes to see if a state change has happened.
+  (Varun Thacker via Anshum Gupta)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/OverseerAutoReplicaFailoverThread.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/OverseerAutoReplicaFailoverThread.java?rev=1651223&r1=1651222&r2=1651223&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/OverseerAutoReplicaFailoverThread.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/cloud/OverseerAutoReplicaFailoverThread.java Mon Jan 12 22:56:31 2015
@@ -20,6 +20,7 @@ package org.apache.solr.cloud;
 import java.io.Closeable;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -85,6 +86,7 @@ public class OverseerAutoReplicaFailover
   private volatile boolean isClosed;
   private ZkStateReader zkStateReader;
   private final Cache<String,Long> baseUrlForBadNodes;
+  private Set<String> liveNodes = Collections.EMPTY_SET;
 
   private final int workLoopDelay;
   private final int waitAfterExpiration;
@@ -151,11 +153,13 @@ public class OverseerAutoReplicaFailover
       return;
     }
     if (clusterState != null) {
-      if (lastClusterStateVersion == clusterState.getZkClusterStateVersion() && baseUrlForBadNodes.size() == 0) {
+      if (lastClusterStateVersion == clusterState.getZkClusterStateVersion() && baseUrlForBadNodes.size() == 0 &&
+          liveNodes.equals(clusterState.getLiveNodes())) {
         // nothing has changed, no work to do
         return;
       }
-      
+
+      liveNodes = clusterState.getLiveNodes();
       lastClusterStateVersion = clusterState.getZkClusterStateVersion();
       Set<String> collections = clusterState.getCollections();
       for (final String collection : collections) {