# Cluster Upgrade, Shard Allocation and null vs all

**URL:** https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867
**Category:** Elasticsearch
**Created:** [January 31, 2022, 6:01pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867 "2022-01-31T18:01:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![georgef](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@georgef](https://discuss.elastic.co/u/georgef)
#### Post date: [January 31, 2022, 6:01pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/1 "2022-01-31T18:01:22Z")

</div>

Good Afternoon,

I was conducting a rolling upgrade from 7.16.2 to 7.16.3 using the directions at [Rolling upgrades | Elasticsearch Guide [7.16]](https://www.elastic.co/guide/en/elasticsearch/reference/current/rolling-upgrades.html). I stopped shard allocation with "cluster.routing.allocation.enable": primaries, and received the following response:  
{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"primaries"}}}},"transient":{}}

However, I was not able to restart with "cluster.routing.allocation.enable": null, and received the following response:  
{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"No enum constant org.Elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.Allocation.NULL"}],"type":"illegal\_argument\_exception","reason":"No enum constant org.Elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.Allocation.NULL"},"status":400}

Reading "[Cluster-level shard allocation and routing settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#modules-cluster)" I found the default is 'all':

- `all` - (default) Allows shard allocation for all kinds of shards.

So I used 'all' in place of 'null' and shard allocation started again. I received the following response:  
{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"all"}}}},"transient":{}}

I receive the same error on all three nodes in cluster when using 'null' and was able to restart allocation on all three nodes using 'all' instead.

My question is simply, is this okay? I tried to use null again after using all and received the same error messages. The cluster is green and allocation appears to be okay. There are no unassigned shards. Is there anything I should try to correct or examine?

Your guidance is appreciated.

Thanks,  
George

---

<div class="post-metadata">

### Author: ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)
#### Post date: [January 31, 2022, 6:38pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/2 "2022-01-31T18:38:37Z")

</div>

It sounds like there is a typo or something in the command you're running, `null`, should work.

Command from Kibana Dev Tools Console:

```auto
PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.enable": null
  }
}

```

---

<div class="post-metadata">

### Author: ![georgef](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@georgef](https://discuss.elastic.co/u/georgef)
#### Post date: [January 31, 2022, 6:56pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/3 "2022-01-31T18:56:13Z")

</div>

Thanks for the quick response. It worked in Kibana Dev Tools Console.

I was using Postman. Postman appears to work when setting "primaries" with double quotes. However, when setting null, it appears to work with no quotes.

```auto
{
  "persistent": {
    "cluster.routing.allocation.enable": "primaries"
  }
}

```

vs

```auto
{
  "persistent": {
    "cluster.routing.allocation.enable": null
  }
}

```

Thanks again.

---

<div class="post-metadata">

### Author: ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)
#### Post date: [January 31, 2022, 7:14pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/4 "2022-01-31T19:14:05Z")

</div>

Looking at your original error, it looks like postman, might be converting `null` to `NULL`, which I don't think is a valid value. Not very familiar with postman, so don't know if this is correct, and if so, if there is a workaround.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 31, 2022, 9:31pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/5 "2022-01-31T21:31:35Z")

</div>

> [@georgef](#):
>
> I receive the same error on all three nodes in cluster when using 'null' and was able to restart allocation on all three nodes using 'all' instead.

Allocation is a cluster level setting, you don't need to run it against each node.

---

<div class="post-metadata">

### Author: ![georgef](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@georgef](https://discuss.elastic.co/u/georgef)
#### Post date: [February 2, 2022, 4:07pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/6 "2022-02-02T16:07:49Z")

</div>

Great tip. Thank you.

---

<div class="post-metadata">

### Author: ![georgef](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@georgef](https://discuss.elastic.co/u/georgef)
#### Post date: [February 2, 2022, 4:08pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/7 "2022-02-02T16:08:19Z")

</div>

Thank you.

---

<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: [March 2, 2022, 4:09pm UTC](https://discuss.elastic.co/t/cluster-upgrade-shard-allocation-and-null-vs-all/295867/8 "2022-03-02T16:09:07Z")

</div>

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