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

Throw error when incorrect setting applied to auto_expand_replicas #5752

Closed
mdaniel opened this issue Apr 9, 2014 · 2 comments
Closed

Throw error when incorrect setting applied to auto_expand_replicas #5752

mdaniel opened this issue Apr 9, 2014 · 2 comments

Comments

@mdaniel
Copy link
Contributor

mdaniel commented Apr 9, 2014

I tried PUTting {"index":{"auto_expand_replicas":"all"}} to an index and it came back with {"acknowledged":true}. However, in the logs there was a confusing explosion:

[2014-04-09 17:55:54,873][WARN ][cluster.metadata         ] [hostname] failed to set [index.auto_expand_replicas], wrong format [all]
java.lang.StringIndexOutOfBoundsException: String index out of range: -1

which was I did not find to be a helpful error message.

I thought that all was a legitimate value for this setting, and only through reading the source code did I learn that it is always range, even when providing all as the upper bound.

I have a fix for this usability problem, but the guidelines said I should discuss it first, so let's discuss.

@smarts
Copy link

smarts commented May 23, 2014

I ran into the same problem. Glad this Issue was indexed by Google! 👍

@nik9000
Copy link
Member

nik9000 commented May 24, 2014

Left some comments. You should probably just submit the patch as a pull request. That is typically a fine venue for discussion.

@jpountz jpountz closed this as completed in b0a85f6 Jun 6, 2014
jpountz pushed a commit that referenced this issue Jun 6, 2014
Previously if the user provided a non-conforming string, it would blow up with
`java.lang.StringIndexOutOfBoundsException: String index out of range: -1`
which is not a *helpful* error message.

Also updated the documentation to make the possible setting values more clear.

Close #5752
@jpountz jpountz changed the title auto_expand_replicas explodes with a value of "all" Settings: auto_expand_replicas explodes with a value of "all" Jun 6, 2014
@clintongormley clintongormley changed the title Settings: auto_expand_replicas explodes with a value of "all" Settings: Throw error when incorrect setting applied to auto_expand_replicas Jul 16, 2014
@clintongormley clintongormley added the :Core/Infra/Settings Settings infrastructure and APIs label Jun 7, 2015
@clintongormley clintongormley changed the title Settings: Throw error when incorrect setting applied to auto_expand_replicas Throw error when incorrect setting applied to auto_expand_replicas Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants