lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject lucene-solr:master: SOLR-9030: The 'downnode' overseer command can trip asserts in ZkStateWriter
Date Wed, 04 May 2016 23:46:57 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master dccf6a4d9 -> c2662f24a


SOLR-9030: The 'downnode' overseer command can trip asserts in ZkStateWriter


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

Branch: refs/heads/master
Commit: c2662f24ac171c38aa17c0b7bbae0fd6b43652b5
Parents: dccf6a4
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Thu May 5 05:16:39 2016 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Thu May 5 05:16:39 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                            | 3 +++
 .../java/org/apache/solr/cloud/overseer/ZkStateWriter.java  | 1 -
 .../java/org/apache/solr/common/cloud/DocCollection.java    | 9 +++++----
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c2662f24/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 31311cd..9c91a5f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -181,6 +181,9 @@ Bug Fixes
 
 * SOLR-9064: Adds an explanation of the incoming stream to an UpdateStream's explanation
(Dennis Gove)
 
+* SOLR-9030: The 'downnode' overseer command can trip asserts in ZkStateWriter.
+  (Scott Blum, Mark Miller, shalin)
+
 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/c2662f24/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
index e9edef1..c3d49f7 100644
--- a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
+++ b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java
@@ -229,7 +229,6 @@ public class ZkStateWriter {
             byte[] data = Utils.toJSON(singletonMap(c.getName(), c));
             if (reader.getZkClient().exists(path, true)) {
               log.info("going to update_collection {} version: {}", path, c.getZNodeVersion());
-              assert c.getZNodeVersion() >= 0;
               Stat stat = reader.getZkClient().setData(path, data, c.getZNodeVersion(), true);
               DocCollection newCollection = new DocCollection(name, c.getSlicesMap(), c.getProperties(),
c.getRouter(), stat.getVersion(), path);
               clusterState = clusterState.copyWith(name, newCollection);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c2662f24/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
index 9e4418c..590c155 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
@@ -41,7 +41,8 @@ public class DocCollection extends ZkNodeProps {
   public static final String STATE_FORMAT = "stateFormat";
   public static final String RULE = "rule";
   public static final String SNITCH = "snitch";
-  private int znodeVersion = -1; // sentinel
+
+  private final int znodeVersion;
 
   private final String name;
   private final Map<String, Slice> slices;
@@ -55,7 +56,7 @@ public class DocCollection extends ZkNodeProps {
 
 
   public DocCollection(String name, Map<String, Slice> slices, Map<String, Object>
props, DocRouter router) {
-    this(name, slices, props, router, -1, ZkStateReader.CLUSTER_STATE);
+    this(name, slices, props, router, Integer.MAX_VALUE, ZkStateReader.CLUSTER_STATE);
   }
 
   /**
@@ -64,8 +65,8 @@ public class DocCollection extends ZkNodeProps {
    * @param props  The properties of the slice.  This is used directly and a copy is not
made.
    */
   public DocCollection(String name, Map<String, Slice> slices, Map<String, Object>
props, DocRouter router, int zkVersion, String znode) {
-    super(props==null ? props = new HashMap<String,Object>() : props);
-    this.znodeVersion = zkVersion;
+    super(props==null ? props = new HashMap<>() : props);
+    this.znodeVersion = zkVersion == -1 ? Integer.MAX_VALUE : zkVersion;
     this.name = name;
 
     this.slices = slices;


Mime
View raw message