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

Fix handling of IndicesOptions in update settings REST API #10030

Conversation

obourgain
Copy link
Contributor

The Update Settings API tries to merge the query params with the settings sent as body and excluding some "well known params" such as pretty, timeouts ...
Those well known params does not include the params used by IndicesOptions, so ES merges those params with the settings but the resulting settings are invalid.
e.g.

curl -XPUT 'localhost:9200/twitter/_settings?expand_wildcards&pretty' -d '
{
    "index" : {
        "number_of_replicas" : 2
    }
}'

returns

{
  "error" : "ElasticsearchIllegalArgumentException[Can't update non dynamic settings[[index.expand_wildcards]] for open indices[[twitter]]]",
  "status" : 400
}

but works correctly without params relate to IndicesOptions.

I did not look at other APIs but some may suffer from the same issue.

@javanna javanna added >bug :Core/Infra/Settings Settings infrastructure and APIs v1.6.0 labels Mar 21, 2015
@javanna javanna self-assigned this Mar 21, 2015
@javanna javanna closed this in 9561678 Mar 21, 2015
javanna pushed a commit that referenced this pull request Mar 21, 2015
…T layer

The Update Settings API tries to merge the query_string params with the settings sent as body and excluding some "well known params" such as `pretty`, `timeout` etc. Those well known params do not include the params used by IndicesOptions though, so they get merged resulting in invalid settings that get rejected.

Closes #10030
@javanna
Copy link
Member

javanna commented Mar 21, 2015

Thanks a lot @obourgain good catch and good fix. I just merged it.

@clintongormley clintongormley changed the title fix handling of IndicesOptions in update settings REST API Fix handling of IndicesOptions in update settings REST API Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants