# Relocation in loop on Elasticsearch 7.7

**URL:** <https://discuss.elastic.co/t/relocation-in-loop-on-elasticsearch-7-7/270486>\
**Category:** Elasticsearch\
**Created:** [April 18, 2021, 6:50am UTC](https://discuss.elastic.co/t/relocation-in-loop-on-elasticsearch-7-7/270486 "2021-04-18T06:50:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dextermorgan](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@dextermorgan](https://discuss.elastic.co/u/dextermorgan)\
**Post date:** [April 18, 2021, 6:50am UTC](https://discuss.elastic.co/t/relocation-in-loop-on-elasticsearch-7-7/270486/1 "2021-04-18T06:50:12Z")

</div>

We recently upgraded from ES 5.4 to ES 7.7 and are facing this weird issue in production where relocation goes in a loop. Have noticed majorly on large clusters and having hot/cold config. e.g. following is cluster config

3 master nodes  
2 nodes with node.attr.tag as hot  
30 nodes with node.attr.tag as cold (relocation in loop on these nodes)

Indices having hot and cold inclusion/exclusion in settings

For the sake of debugging and simplifying things, added following in cluster settings

```auto
cluster_concurrent_rebalance: 10
node_concurrent_recoveries: 1
balance.index: 0.0f
balance.shards: 1.0f

```

Enabled trace logs for BalancedShardsAllocator and went through code and noticed that the first time it relocates the shard to the minNode from maxNode and then saw simulate logs which increase number of shards on that minNode on the model due to throttling. So, in next indices run, the shards on minNode increase in theory and that leads to shards moving away from minNode even if (in actual) it has less shards. Attaching logs for same.

Logic and code wise this is the case with ES 5.4 as well but we never faced this issue there. Could someones please help on how can I debug this and also why do we simulate relocation and theoretically increase shards on node?

[Ubuntu Pastebin](https://pastebin.ubuntu.com/p/3S27wR2B2b/) - Node RlZgpH1xTYKuEjn1gyH3CA is the one which has least shards when i enable rebalance shards.

---

<div class="post-metadata">

**Author:** ![dextermorgan](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@dextermorgan](https://discuss.elastic.co/u/dextermorgan)\
**Post date:** [April 26, 2021, 1:25pm UTC](https://discuss.elastic.co/t/relocation-in-loop-on-elasticsearch-7-7/270486/2 "2021-04-26T13:25:18Z")

</div>

Gentle reminder if anyone could help me with the query.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 24, 2021, 1:26pm UTC](https://discuss.elastic.co/t/relocation-in-loop-on-elasticsearch-7-7/270486/3 "2021-05-24T13:26:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
