`delta` is always positive here. Co-authored-by: Howard <danielhuang@tencent.com>
This commit is contained in:
parent
b21330b00c
commit
46e5c37267
|
@ -477,13 +477,8 @@ public class RoutingTable implements Iterable<IndexRoutingTable>, Diffable<Routi
|
|||
builder.addReplica();
|
||||
}
|
||||
} else if (currentNumberOfReplicas > numberOfReplicas) {
|
||||
int delta = currentNumberOfReplicas - numberOfReplicas;
|
||||
if (delta <= 0) {
|
||||
// ignore, can't remove below the current one...
|
||||
} else {
|
||||
for (int i = 0; i < delta; i++) {
|
||||
builder.removeReplica();
|
||||
}
|
||||
for (int i = 0; i < (currentNumberOfReplicas - numberOfReplicas); i++) {
|
||||
builder.removeReplica();
|
||||
}
|
||||
}
|
||||
indicesRouting.put(index, builder.build());
|
||||
|
|
Loading…
Reference in New Issue