mirror of https://github.com/apache/lucene.git
SOLR-9030: The 'downnode' overseer command can trip asserts in ZkStateWriter
This commit is contained in:
parent
dccf6a4d98
commit
c2662f24ac
|
@ -181,6 +181,9 @@ Bug Fixes
|
||||||
|
|
||||||
* SOLR-9064: Adds an explanation of the incoming stream to an UpdateStream's explanation (Dennis Gove)
|
* 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
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
* SOLR-8722: Don't force a full ZkStateReader refresh on every Overseer operation.
|
* SOLR-8722: Don't force a full ZkStateReader refresh on every Overseer operation.
|
||||||
|
|
|
@ -229,7 +229,6 @@ public class ZkStateWriter {
|
||||||
byte[] data = Utils.toJSON(singletonMap(c.getName(), c));
|
byte[] data = Utils.toJSON(singletonMap(c.getName(), c));
|
||||||
if (reader.getZkClient().exists(path, true)) {
|
if (reader.getZkClient().exists(path, true)) {
|
||||||
log.info("going to update_collection {} version: {}", path, c.getZNodeVersion());
|
log.info("going to update_collection {} version: {}", path, c.getZNodeVersion());
|
||||||
assert c.getZNodeVersion() >= 0;
|
|
||||||
Stat stat = reader.getZkClient().setData(path, data, c.getZNodeVersion(), true);
|
Stat stat = reader.getZkClient().setData(path, data, c.getZNodeVersion(), true);
|
||||||
DocCollection newCollection = new DocCollection(name, c.getSlicesMap(), c.getProperties(), c.getRouter(), stat.getVersion(), path);
|
DocCollection newCollection = new DocCollection(name, c.getSlicesMap(), c.getProperties(), c.getRouter(), stat.getVersion(), path);
|
||||||
clusterState = clusterState.copyWith(name, newCollection);
|
clusterState = clusterState.copyWith(name, newCollection);
|
||||||
|
|
|
@ -41,7 +41,8 @@ public class DocCollection extends ZkNodeProps {
|
||||||
public static final String STATE_FORMAT = "stateFormat";
|
public static final String STATE_FORMAT = "stateFormat";
|
||||||
public static final String RULE = "rule";
|
public static final String RULE = "rule";
|
||||||
public static final String SNITCH = "snitch";
|
public static final String SNITCH = "snitch";
|
||||||
private int znodeVersion = -1; // sentinel
|
|
||||||
|
private final int znodeVersion;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final Map<String, Slice> slices;
|
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) {
|
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.
|
* @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) {
|
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);
|
super(props==null ? props = new HashMap<>() : props);
|
||||||
this.znodeVersion = zkVersion;
|
this.znodeVersion = zkVersion == -1 ? Integer.MAX_VALUE : zkVersion;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
||||||
this.slices = slices;
|
this.slices = slices;
|
||||||
|
|
Loading…
Reference in New Issue