Fix active replica count reporting in SimClusterStateProvider

One codepath assumed all replicas were active, instead of checking the
state of each individually.
This commit is contained in:
Jason Gerlowski 2018-12-14 11:07:10 -05:00
parent dd910d1a06
commit 655e9ecf7c
1 changed files with 6 additions and 1 deletions

View File

@ -1998,7 +1998,12 @@ public class SimClusterStateProvider implements ClusterStateProvider {
if (buffered != null) {
bufferedDocs += buffered.get();
}
activeReplicas += s.getReplicas().size();
for (Replica r : s.getReplicas()) {
if (r.getState() == Replica.State.ACTIVE) {
activeReplicas++;
}
}
Replica leader = s.getLeader();
if (leader == null) {
noLeader++;