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

String settings leniently accept lists #33135

Open
DaveCTurner opened this issue Aug 24, 2018 · 14 comments
Open

String settings leniently accept lists #33135

DaveCTurner opened this issue Aug 24, 2018 · 14 comments
Assignees
Labels
>bug :Core/Infra/Settings Settings infrastructure and APIs good first issue low hanging fruit Team:Core/Infra Meta label for core/infra team team-discuss triaged Issue has been looked at, and is being left open

Comments

@DaveCTurner
Copy link
Contributor

DaveCTurner commented Aug 24, 2018

If you got here from the good first issue label, see this comment.

For example, the following elasticsearch.yml ...

node.name:
- node-a
- node-b

... starts up a node called [node-a, node-b]:

[2018-08-24T17:08:43,807][INFO ][o.e.n.Node               ] [[node-a, node-b]] initializing ...

In fact this is what's happening in #30946. The following API call...

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

... sets cluster.routing.allocation.exclude._name to the string [elasticsearch-data-0], which then does not match the node called elasticsearch-data-0 so the allocation is not filtered as expected.

@DaveCTurner DaveCTurner added >bug :Core/Infra/Settings Settings infrastructure and APIs labels Aug 24, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@original-brownbear original-brownbear self-assigned this Sep 7, 2018
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this issue Sep 7, 2018
* Special handling for `String` in the generic
Setting class because we parse raw values
String values for all types:
  * If we parse out a `String` setting validate
that it came from a scalar raw value
* Closes elastic#33135
@original-brownbear
Copy link
Member

The fix broke 6.x Tribe tests, reopening ...
see #33660

@original-brownbear
Copy link
Member

original-brownbear commented Sep 17, 2018

@s1monw @jasontedor question here:

Is it true that the only reason we can't do 6075e15 is because they break the "dummy settings" used by Tribe here: https://github.com/elastic/elasticsearch/blob/6.x/modules/tribe/src/main/java/org/elasticsearch/tribe/TribePlugin.java#L177
... because those always assume String / scalar type for the dummies even if the key would in fact contain a list?

Or is this kind of hard validation a problem beyond just Tribe and we want to allow this kind of "validation" or mixed list and scalar settings in general?

@bczifra
Copy link
Member

bczifra commented Jun 25, 2019

A use can specify node.attr.foo : [ "bar", "baz" ] in elasticsearch.yml, and Elasticsearch starts up without logging anything at all indicating that this is not supported behavior, so setting "index.routing.allocation.require.foo": "bar" won't match "[bar, baz]" and the index shards won't be allocated. This can be particularly confusing because allocation awareness attributes do support multiple values.

@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@gwbrown
Copy link
Contributor

gwbrown commented Dec 4, 2020

@original-brownbear Did you ever get an answer to your question? Can we reintroduce the fix now that Tribe has been removed?

@original-brownbear
Copy link
Member

@gwbrown

Did you ever get an answer to your question? Can we reintroduce the fix now that Tribe has been removed?

No but I think we can give the fix another go, it did only affect Tribe in the past. Do you want/need this in the near future? (should be trivial to open a new PR that is the same as the original fix)

@gwbrown
Copy link
Contributor

gwbrown commented Dec 7, 2020

Thanks! I have no particular need for this - this is part of core/infra's issue cleanup and I was just checking on the current status. Sounds like we just need someone to make sure your original patch from #33503 is up to date for current master and re-submit.

@gwbrown gwbrown added good first issue low hanging fruit and removed needs:triage Requires assignment of a team area label labels Dec 7, 2020
@amitds1997
Copy link

If no one's working on this, can I give this a shot?

@rjernst
Copy link
Member

rjernst commented Apr 5, 2021

@amitds1997 You are welcome to try. Note that this may be a little tricky, though I don't want to deter you from attempting it. I believe the underlying problem is Settings.get calls toString() internally. This is so other types (eg numbers) always get returned as Strings. Fixing will probably involve adjusting that assumption.

@amitds1997
Copy link

@rjernst What I gathered from gwbrown's comment is that we have to re-implement the original patch against the master. Please let me know if I have missed out on anything not present in that patch.

@rjernst
Copy link
Member

rjernst commented Apr 6, 2021

@amitds1997 That could be it, I'm not sure. It should be simple to test, though.

@mosche
Copy link
Contributor

mosche commented Nov 8, 2024

Still an issue, discussing with Core/Infra to prioritise

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@mosche mosche added the triaged Issue has been looked at, and is being left open label Nov 8, 2024
@mosche
Copy link
Contributor

mosche commented Nov 27, 2024

Note: This will require a deprecation warning to prevent clusters from breaking when upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Settings Settings infrastructure and APIs good first issue low hanging fruit Team:Core/Infra Meta label for core/infra team team-discuss triaged Issue has been looked at, and is being left open
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants