dsmiley commented on code in PR #2916:
URL: https://github.com/apache/solr/pull/2916#discussion_r1894402071
##########
solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java:
##########
@@ -295,22 +288,19 @@ private Map<String, Object> getCollectionStatus(
@SuppressWarnings("unchecked")
protected void crossCheckReplicaStateWithLiveNodes(
List<String> liveNodes, Map<String, Object> collectionProps) {
- for (Map.Entry<String, Object> next : collectionProps.entrySet()) {
- Map<String, Object> collMap = (Map<String, Object>) next.getValue();
- Map<String, Object> shards = (Map<String, Object>) collMap.get("shards");
- for (Object nextShard : shards.values()) {
- Map<String, Object> shardMap = (Map<String, Object>) nextShard;
- Map<String, Object> replicas = (Map<String, Object>)
shardMap.get("replicas");
- for (Object nextReplica : replicas.values()) {
- Map<String, Object> replicaMap = (Map<String, Object>) nextReplica;
- if (Replica.State.getState((String)
replicaMap.get(ZkStateReader.STATE_PROP))
- != Replica.State.DOWN) {
- // not down, so verify the node is live
- String node_name = (String)
replicaMap.get(ZkStateReader.NODE_NAME_PROP);
- if (!liveNodes.contains(node_name)) {
- // node is not live, so this replica is actually down
- replicaMap.put(ZkStateReader.STATE_PROP,
Replica.State.DOWN.toString());
- }
+ Map<String, Object> shards = (Map<String, Object>)
collectionProps.get("shards");
+ for (Object nextShard : shards.values()) {
+ Map<String, Object> shardMap = (Map<String, Object>) nextShard;
+ Map<String, Object> replicas = (Map<String, Object>)
shardMap.get("replicas");
+ for (Object nextReplica : replicas.values()) {
+ Map<String, Object> replicaMap = (Map<String, Object>) nextReplica;
Review Comment:
totally understood. In some old Solr code like this, there's always "and
one more thing" we could/should do but ultimately snowballs the scope out of
control. I leave it to you to do as you wish. Thank you for your contribution
here; I didn't mean to get more out of you than you bargained for :-)
--
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]