Module org.elasticsearch.server
Class ThrottlingAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider
ThrottlingAllocationDecider controls the recovery process per node in
the cluster. It exposes two settings via the cluster update API that allow
changes in real-time:
cluster.routing.allocation.node_initial_primaries_recoveries- restricts the number of initial primary shard recovery operations on a single node. The default is4cluster.routing.allocation.node_concurrent_recoveries- restricts the number of total concurrent shards initializing on a single node. The default is2
If one of the above thresholds is exceeded per node this allocation decider
will return Decision.THROTTLE as a hit to upstream logic to throttle
the allocation process to prevent overloading nodes due to too many concurrent recovery
processes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether the given shard routing can be allocated on the given node.canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether the given shard can be forced to the given node in the event that the shard's source node is being replaced.static ShardRoutinginitializingShard(ShardRouting shardRouting, String currentNodeId) The shard routing passed tocanAllocate(ShardRouting, RoutingNode, RoutingAllocation)is not the initializing shard to this node but: - the unassigned shard routing in case if we want to assign an unassigned shard to this node.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canAllocateReplicaWhenThereIsRetentionLease, canForceAllocatePrimary, canRebalance, canRebalance, canRemain, getForcedInitialShardAllocationToNodes, shouldAutoExpandToNode
-
Field Details
-
DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES
public static final int DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES- See Also:
-
DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES
public static final int DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES- See Also:
-
NAME
- See Also:
-
CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES_SETTING
-
CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES_SETTING
-
CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING
-
CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING
-
-
Constructor Details
-
ThrottlingAllocationDecider
-
-
Method Details
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS.- Overrides:
canAllocatein classAllocationDecider
-
canForceAllocateDuringReplace
public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard can be forced to the given node in the event that the shard's source node is being replaced. This allows nodes using a replace-type node shutdown to override certain deciders in the interest of moving the shard away from a node that *must* be removed. It defaults to returning "YES" and must be overridden by deciders that opt-out to having their other NO decisions *not* overridden while vacating. The caller is responsible for first checking: - that a replacement is ongoing - the shard routing's current node is the source of the replacement- Overrides:
canForceAllocateDuringReplacein classAllocationDecider
-
initializingShard
The shard routing passed tocanAllocate(ShardRouting, RoutingNode, RoutingAllocation)is not the initializing shard to this node but: - the unassigned shard routing in case if we want to assign an unassigned shard to this node. - the initializing shard routing if we want to assign the initializing shard to this node instead - the started shard routing in case if we want to check if we can relocate to this node. - the relocating shard routing if we want to relocate to this node now instead. This method returns the corresponding initializing shard that would be allocated to this node.
-