Cluster Upgrade, Shard Allocation and null vs all

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]. 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" 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

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

Command from Kibana Dev Tools Console:

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

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.

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

vs

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

Thanks again.

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.

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

Great tip. Thank you.

Thank you.

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