File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
server/src/main/java/org/elasticsearch Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,10 @@ public boolean hasInactivePrimaries() {
267267 return inactivePrimaryCount > 0 ;
268268 }
269269
270+ public boolean hasInactiveReplicas () {
271+ return inactiveShardCount > inactivePrimaryCount ;
272+ }
273+
270274 public boolean hasInactiveShards () {
271275 return inactiveShardCount > 0 ;
272276 }
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public void beforeAllocation(final RoutingAllocation allocation) {
121121 @ Override
122122 public void afterPrimariesBeforeReplicas (RoutingAllocation allocation ) {
123123 assert replicaShardAllocator != null ;
124- if (allocation .routingNodes ().hasInactiveShards ()) {
124+ if (allocation .routingNodes ().hasInactiveReplicas ()) {
125125 // cancel existing recoveries if we have a better match
126126 replicaShardAllocator .processExistingRecoveries (allocation );
127127 }
You can’t perform that action at this time.
0 commit comments