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

Response for create index with config {"refresh_interval": "300"} is misleading #17344

Closed
adol001 opened this issue Mar 25, 2016 · 3 comments
Closed

Comments

@adol001
Copy link

adol001 commented Mar 25, 2016

Elasticsearch version: 2.2.1

JVM version: 1.7.0_60

OS version: cent os

Description of the problem including expected versus actual behavior:
In es 1.x generation, create index with config {"refresh_interval": "300"} is ok, but in es 2.2.1, create index with config {"refresh_interval": "300"}, the response is {"acknowledged":true} and index created, but no one shard is assigned, the message in log is

[error_info11][[error_info11][37]] ElasticsearchException[failed to create shard]; nested: ElasticsearchParseException[Failed to parse setting [index.refresh_interval] with value [300] as a time value: unit is missing or unrecognized]; at org.elasticsearch.index.IndexService.createShard(IndexService.java:371) at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyInitializingShard(IndicesClusterStateService.java:602) at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyNewOrUpdatedShards(IndicesClusterStateService.java:502) at org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:166) at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:600) at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:762) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:231) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:194) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: ElasticsearchParseException[Failed to parse setting [index.refresh_interval] with value [300] as a time value: unit is missing or unrecognized]
So index is created, but you can't use

I know the true config is {"refresh_interval": "300s"}, but I think the response is error with error message and index created false rather than response is {"acknowledged":true} and created index yout can't use

Steps to reproduce:

curl -XPOST dmslave22.et2:9200/test -d '{ "settings": { "refresh_interval": "300" }, "mappings": { "_default_":{ "properties": { "field1": { "type": "string" } } } } }'

Provide logs (if relevant):

Describe the feature:

Response for create index with config {"refresh_interval": "300"} is misleading

@clintongormley
Copy link

In 2.x, units are required. In fact, units are there to help you avoid the mistake that you made. In 1.x, 300 means 300ms, not 300s! I agree that the action of creating the index but then failing on shard creation is poor. This has been fixed in 5.0 with #17187

@s1monw
Copy link
Contributor

s1monw commented Mar 25, 2016

I think the actual problem here is the {"acknowledged":true} is the problem here. In 5.0 this request would have been rejected so it's fixed in 5.0. Unfortunately backporting to 2.x is not feasible.

@suederade
Copy link

There is no documentation on what are valid values for refresh_interval, even in 7.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants