dsmiley commented on code in PR #2599:
URL: https://github.com/apache/solr/pull/2599#discussion_r1704656293
##########
solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java:
##########
@@ -89,14 +93,61 @@ public static Health combine(Collection<Health> states) {
}
}
- public ClusterStatus(ZkStateReader zkStateReader, ZkNodeProps props) {
+ public ClusterStatus(ZkStateReader zkStateReader, SolrParams params) {
this.zkStateReader = zkStateReader;
- this.message = props;
- collection = props.getStr(ZkStateReader.COLLECTION_PROP);
+ this.solrParams = params;
+ collection = params.get(ZkStateReader.COLLECTION_PROP);
}
public void getClusterStatus(NamedList<Object> results)
throws KeeperException, InterruptedException {
+ List<String> liveNodes = null;
+ NamedList<Object> clusterStatus = new SimpleOrderedMap<>();
+
+ boolean includeAll = this.solrParams.getBool(INCLUDE_ALL, true);
+ boolean withLiveNodes =
+ this.solrParams.getBool(LIVENODES_PROP, includeAll) || (collection !=
null);
Review Comment:
Okay I understand that crossCheckReplicaStateWithLiveNodes (used by
collection processing) depends on liveNodes. But the client didn't request
liveNodes, therefore we shouldn't return it. I think "withLiveNodes" boolean
should be simple/obvious here, as the others. Instead down below, you could
modify the condition that decides to gather liveNodes by also checking if
collection processing is needed. But still; don't set on the response unless
"withLiveNodes".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]