`delta` is always positive here. Co-authored-by: Howard <danielhuang@tencent.com>
This commit is contained in:
parent
b21330b00c
commit
46e5c37267
|
@ -477,15 +477,10 @@ 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++) {
|
||||
for (int i = 0; i < (currentNumberOfReplicas - numberOfReplicas); i++) {
|
||||
builder.removeReplica();
|
||||
}
|
||||
}
|
||||
}
|
||||
indicesRouting.put(index, builder.build());
|
||||
}
|
||||
return this;
|
||||
|
|
Loading…
Reference in New Issue