shrink doesn't work with number_of_replicas > 0
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 627
- PR merge metrics
- No merged PRs in 30d
Description
Shrinking with `number_of_replicas: 1` stalls with infinite "Wait for shards to complete allocation for index" message in log. After verifying, new (shrunk) index has `index.routing.allocation.require._name` set, so replicas can't get out of node that performed shrinking.
As a workaround I can set
```
extra_settings:
settings:
index.routing.allocation.require._name: null
```
This started happening after I upgraded my Elasticsearch cluster from 6.7 to 7.4 and Curator from
5.7.6 to 5.8.1.
Action configuration:
```yaml
options:
ignore_empty_list: True
continue_if_exception: False
shrink_node: DETERMINISTIC
node_filters:
permit_masters: True
number_of_shards: 1
number_of_replicas: 1
shrink_prefix: ''
shrink_suffix: '-shrink'
delete_after: True
wait_for_active_shards: 1
extra_settings:
settings:
index.codec: best_compression
wait_for_completion: True
wait_for_rebalance: True
wait_interval: 9
max_wait: -1
```
Log: [curator.log](https://github.com/elastic/curator/files/3697091/curator.log)
Contributor guide
Research direction
Start by reproducing the shrink action with number_of_replicas: 1 and the supplied action configuration, then inspect the log for the allocation wait. Verify whether the shrunk index retains index.routing.allocation.require._name; done means replicas complete allocation without the infinite wait, while preserving the reported shrink settings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, python
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100