mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-11 23:45:15 +00:00
if shard is not started, don't allow to move it
we already only run on started shards in the single place where we use move, but this is a better check in general
This commit is contained in:
parent
5b6b94cf83
commit
eb95bb50a8
@ -165,7 +165,9 @@ public class EvenShardsCountAllocator extends AbstractComponent implements Shard
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean move(MutableShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
|
public boolean move(MutableShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
|
||||||
assert shardRouting.started();
|
if (!shardRouting.started()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
RoutingNode[] sortedNodesLeastToHigh = sortedNodesLeastToHigh(allocation);
|
RoutingNode[] sortedNodesLeastToHigh = sortedNodesLeastToHigh(allocation);
|
||||||
if (sortedNodesLeastToHigh.length == 0) {
|
if (sortedNodesLeastToHigh.length == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user