Module org.elasticsearch.server
Class UndesiredAllocationsTracker
java.lang.Object
org.elasticsearch.cluster.routing.allocation.allocator.UndesiredAllocationsTracker
Keeps track of a limited number of shards that are currently in undesired allocations. If the
shards remain in undesired allocations for longer than a configurable threshold, it will log
why those shards can't be allocated to desired nodes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe maximum number of undesired allocations to track.The minimum amount of time between warnings about persistent undesired allocationsWarning logs will be periodically written if we see a shard that's been in an undesired allocation for this long -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup(RoutingNodes routingNodes) Clear anyShardRoutingthat are no longer present in the routing nodesvoidclear()Clear all tracked allocationsvoidmaybeLogUndesiredShardsWarning(RoutingNodes routingNodes, RoutingAllocation routingAllocation, DesiredBalance desiredBalance) If there are shards that have been in undesired allocations for longer than the configured threshold, log a warningvoidremoveTracking(ShardRouting shardRouting) Remove any tracking of the specified allocation (a no-op if the allocation isn't being tracked)voidtrackUndesiredAllocation(ShardRouting shardRouting) Track an allocation as being undesired
-
Field Details
-
UNDESIRED_ALLOCATION_DURATION_LOG_THRESHOLD_SETTING
Warning logs will be periodically written if we see a shard that's been in an undesired allocation for this long -
UNDESIRED_ALLOCATION_DURATION_LOG_INTERVAL_SETTING
The minimum amount of time between warnings about persistent undesired allocations -
MAX_UNDESIRED_ALLOCATIONS_TO_TRACK
The maximum number of undesired allocations to track. We expect this to be relatively small.
-
-
Method Details
-
trackUndesiredAllocation
Track an allocation as being undesired -
removeTracking
Remove any tracking of the specified allocation (a no-op if the allocation isn't being tracked) -
cleanup
Clear anyShardRoutingthat are no longer present in the routing nodes -
clear
public void clear()Clear all tracked allocations -
maybeLogUndesiredShardsWarning
public void maybeLogUndesiredShardsWarning(RoutingNodes routingNodes, RoutingAllocation routingAllocation, DesiredBalance desiredBalance) If there are shards that have been in undesired allocations for longer than the configured threshold, log a warning -
disableMissingAllocationAssertions
-