mirror of https://github.com/apache/lucene.git
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:
parent
dd910d1a06
commit
655e9ecf7c
|
@ -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++;
|
||||
|
|
Loading…
Reference in New Issue