Skip to content

PUT cluster.routing.allocation.exclude handling with array value #30946

@jordansissel

Description

@jordansissel

Describe the feature:

PUT cluster.routing.allocation.exclude handling with array value should either work correctly or provide actionable feedback in an error response.

Elasticsearch version (bin/elasticsearch --version): 6.2.3

Plugins installed: [x-pack]

JVM version (java -version): Whatever version ships on the elasticsearch-platinum:6.2.3 docker image

OS version (uname -a if on a Unix-like system): Whatever version ships on the elasticsearch-platinum:6.2.3 docker image

Description of the problem including expected versus actual behavior:

_cluster/settings accepts an array value for cluster.routing.allocation.exclude._name but has no apparent effect.

Expected: A list of names should either be accepted and exclude all entries in the list, or this setting should be rejected and an actionable error message noted in the response.

Steps to reproduce:

PUT _cluster/settings
{
  "transient" : {
    "cluster.routing.allocation.exclude._name" : [ "elasticsearch-data-0" ]
  }
}

<response>
{
  "acknowledged": true,
  "persistent": {},
  "transient": {
    "cluster": {
      "routing": {
        "allocation": {
          "exclude": {
            "_name": [
              "elasticsearch-data-0"
            ]
          }
        }
      }
    }
  }
}

Response is 200 OK and otherwise seems OK. However, no shards are relocated from this node. There is no feedback on the HTTP response that indicates that this setting is invalid.

While checking _cat/shards, I noticed that no shards were being reallocated based on my request which intended to say "Evacuate all shards from elasticsearch-data-0".

The correct setting is, as I read in the docs, to use comma-separated strings:

While attempting to set cluster allocation to drain shards from a node, I did this:

PUT _cluster/settings
{
  "transient" : {
    "cluster.routing.allocation.exclude._name": "elasticsearch-data-0"
  }
}

And then shards are moved away from this node.

Metadata

Metadata

Labels

:Distributed Coordination/AllocationAll issues relating to the decision making around placing a shard (both master logic & on the nodes)>bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions