Class MaxRetryAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider
An allocation decider that prevents shards from being allocated on any node if the shards allocation has been retried N times without
success. This means if a shard has been INITIALIZING N times in a row without being moved to STARTED the shard will be ignored until
the setting for
index.allocation.max_retry
is raised. The default value is 5
.
Note: This allocation decider also allows allocation of repeatedly failing shards when the /_cluster/reroute?retry_failed=true
API is manually invoked. This allows single retries without raising the limits.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncanAllocate(ShardRouting shardRouting, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
.canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated on the given node.canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given primary shard can be forcibly allocated on the given node.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canRebalance, canRebalance, canRemain, shouldAutoExpandToNode
-
Field Details
-
SETTING_ALLOCATION_MAX_RETRY
-
NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
MaxRetryAllocationDecider
public MaxRetryAllocationDecider()
-
-
Method Details
-
canAllocate
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canForceAllocatePrimary
public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Description copied from class:AllocationDecider
Returns aDecision
whether the given primary shard can be forcibly allocated on the given node. This method should only be called for unassigned primary shards where the node has a shard copy on disk. Note: all implementations that override this behavior should take into account the results ofAllocationDecider.canAllocate(ShardRouting, RoutingNode, RoutingAllocation)
before making a decision on force allocation, because force allocation should only be considered if all deciders returnDecision.NO
.- Overrides:
canForceAllocatePrimary
in classAllocationDecider
-