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 590c15546a8..d30a73fa145 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 @@ -66,6 +66,7 @@ public class DocCollection extends ZkNodeProps { */ public DocCollection(String name, Map slices, Map props, DocRouter router, int zkVersion, String znode) { super(props==null ? props = new HashMap<>() : props); + // -1 means any version in ZK CAS, so we choose Integer.MAX_VALUE instead to avoid accidental overwrites this.znodeVersion = zkVersion == -1 ? Integer.MAX_VALUE : zkVersion; this.name = name;