Skip to content

Conversation

@dakrone
Copy link
Member

@dakrone dakrone commented Jun 7, 2021

Backports the following commits to 7.x:

This commit makes ILM aware of different parts of the node shutdown lifecycle. It consists are two
main parts, reacting to the state during execution, and signaling the status of shutdown from ILM.

Reacting to shutdown state
ILM now considers nodes that are going to be shut down when deciding which node to assign for the
shrink action. It uses the `NodeShutdownAllocationDecider` within the `SetSingleNodeAllocateStep` to
not assign shards to a node that will be removed. If an index is already past this step and waiting
for allocation, this commit adds an `isCompletable` method to the
`ClusterStateWaitUntilThresholdStep` so that an allocation that cannot happen can be rewound and
retried on another (non-shutdown) node.

Signaling shutdown status
This commit introduces the `PluginShutdownService` which deals with `ShutdownAwarePlugin` classes.
This class is used to signal shutdowns to plugins, and also to gather the status of a shutdown from
these plugins. ILM implements this `ShutdownAwarePlugin` to signal if an index is in a step that is
unsafe, such as the actual shrink step, so that shutdown will wait until after the allocation rules
have been removed by ILM.

This commit also hooks up the get shutdown API response to consider the statuses of its parts (see
`SingleNodeShutdownMetadata.Status#combine`) when creating a response.

Relates to elastic#70338
@dakrone dakrone added backport :Core/Infra/Node Lifecycle Node startup, bootstrapping, and shutdown v7.14.0 labels Jun 7, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jun 7, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@dakrone
Copy link
Member Author

dakrone commented Jun 7, 2021

@elasticmachine update branch

@dakrone
Copy link
Member Author

dakrone commented Jun 7, 2021

@elasticsearch run elasticsearch-ci/part-1

@dakrone dakrone merged commit f67c0f0 into elastic:7.x Jun 7, 2021
@dakrone dakrone deleted the backport/7.x/pr-73690 branch June 7, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Core/Infra/Node Lifecycle Node startup, bootstrapping, and shutdown Team:Core/Infra Meta label for core/infra team v7.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants