Skip to content

[7.x] Delay shard reassignment from nodes which are known to be restarting (#75606)#76587

Merged
AthenaEryma merged 3 commits intoelastic:7.xfrom
AthenaEryma:backport/7.x/pr-75606
Aug 17, 2021
Merged

[7.x] Delay shard reassignment from nodes which are known to be restarting (#75606)#76587
AthenaEryma merged 3 commits intoelastic:7.xfrom
AthenaEryma:backport/7.x/pr-75606

Conversation

@AthenaEryma
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

…lastic#75606)

This PR makes the delayed allocation infrastructure aware of registered node shutdowns, so that reallocation of shards will be further delayed for nodes which are known to be restarting.

To make this more configurable, the Node Shutdown APIs now support a `allocation_delay` parameter, which defaults to 5 minutes. For example:
```
PUT /_nodes/USpTGYaBSIKbgSUJR2Z9lg/shutdown
{
  "type": "restart",
  "reason": "Demonstrating how the node shutdown API works",
  "allocation_delay": "20m"
}
```

Will cause reallocation of shards assigned to that node to another node to be delayed by 20 minutes. Note that this delay will only be used if it's *longer* than the index-level allocation delay, set via `index.unassigned.node_left.delayed_timeout`.

The `allocation_delay` parameter is only valid for `restart`-type shutdown registrations, and the request will be rejected if it's used with another shutdown type.
@AthenaEryma AthenaEryma merged commit 39acaf1 into elastic:7.x Aug 17, 2021
AthenaEryma added a commit that referenced this pull request Aug 17, 2021
This PR changes the serialization version for the contents of #75606 and re-enables BWC tests following the backport of that PR (backport in #76587).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants