Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster.routing.allocation.awareness.attributes setting does not accept an array of values #30617

Closed
abdonpijpelink opened this issue May 15, 2018 · 2 comments
Assignees
Labels
>bug :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes)

Comments

@abdonpijpelink
Copy link
Contributor

Not sure if this is a bug or a "work as designed", but I see a lot of students run into issues with this in training, so I figured more folks may have problems with this. We may want to make this a bit more user friendly.

When configuring cluster.routing.allocation.awareness.attributes via _cluster/settings, the setting does not accept an array of values. If you do provide an array of values, the cluster will end up in a red status when creating a new index.

Elasticsearch version (bin/elasticsearch --version):

Version: 6.2.4, Build: ccec39f/2018-04-12T20:37:28.497551Z, JVM: 1.8.0_77

Plugins installed: []

none

JVM version (java -version):

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

OS version (uname -a if on a Unix-like system):

Darwin MacBook-1265.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

Description of the problem including expected versus actual behavior:

Because the setting is named "attributes", folks expect to be able to provide an array of values for this setting (for example ["bar","baz"]). However, if you do so, the cluster ends up in a red status when creating a new index. Even when configuring multiple values, these values have to be provided comma-separated as a single string (for example "bar,baz").

Steps to reproduce:

  1. Start a one-node cluster and configure the node with: node.attr.foo: bar
  2. Get the cluster's health and check the status is green or yellow: GET _cluster/health
  3. Apply the following cluster setting:
PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.awareness.attributes": [
      "foo"
    ]
  }
}
  1. Create a new index: PUT my_index
  2. The cluster status is now red: GET _cluster/health
  3. Use GET _cluster/allocation/explain to find out why:
"explanation": "node does not contain the awareness attribute [[foo]]; required attributes cluster setting [cluster.routing.allocation.awareness.attributes=[foo]]"
  1. Change the cluster setting and provide a string value instead of an array:
PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.awareness.attributes": "foo"
  }
}
  1. The cluster is now yellow: GET _cluster/health

Provide logs (if relevant):

[2018-05-15T15:07:10,668][INFO ][o.e.c.m.MetaDataCreateIndexService] [rGKXCKp] [my_index] creating index, cause [api], templates [], shards [5]/[1], mappings []
[2018-05-15T15:07:10,672][INFO ][o.e.c.r.a.AllocationService] [rGKXCKp] Cluster health status changed from [YELLOW] to [RED] (reason: [index [my_index] created]).
[2018-05-15T15:08:21,596][DEBUG][o.e.a.a.c.a.TransportClusterAllocationExplainAction] [rGKXCKp] explaining the allocation for [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false], found shard [[allblogs_us-en][2], node[null], [R], recovery_source[peer recovery], s[UNASSIGNED], unassigned_info[[reason=CLUSTER_RECOVERED], at[2018-05-15T13:05:26.878Z], delayed=false, allocation_status[no_attempt]]]
[2018-05-15T15:09:51,178][INFO ][o.e.c.s.ClusterSettings  ] [rGKXCKp] updating [cluster.routing.allocation.awareness.attributes] from [[foo]] to [foo]
[2018-05-15T15:09:51,178][INFO ][o.e.c.s.ClusterSettings  ] [rGKXCKp] updating [cluster.routing.allocation.awareness.attributes] from [[foo]] to [foo]
[2018-05-15T15:09:51,246][INFO ][o.e.c.r.a.AllocationService] [rGKXCKp] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[my_index][0]] ...]).
@ywelsch
Copy link
Contributor

ywelsch commented May 15, 2018

indeed, I'll fix this

@ywelsch ywelsch added >bug :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) labels May 15, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@ywelsch ywelsch self-assigned this May 15, 2018
ywelsch added a commit that referenced this issue May 16, 2018
Allows the setting to be specified using proper array syntax, for example:
"cluster.routing.allocation.awareness.attributes": [ "foo", "bar", "baz" ]

Closes #30617
ywelsch added a commit that referenced this issue May 16, 2018
Allows the setting to be specified using proper array syntax, for example:
"cluster.routing.allocation.awareness.attributes": [ "foo", "bar", "baz" ]

Closes #30617
ywelsch added a commit that referenced this issue May 16, 2018
Allows the setting to be specified using proper array syntax, for example:
"cluster.routing.allocation.awareness.attributes": [ "foo", "bar", "baz" ]

Closes #30617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes)
Projects
None yet
Development

No branches or pull requests

3 participants