-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Cluster health returns 500 when wait_for_active_shards is set to 'all' #31151
Copy link
Copy link
Closed
Labels
:Distributed/AllocationAll issues relating to the decision making around placing a shard (both master logic & on the nodes)All issues relating to the decision making around placing a shard (both master logic & on the nodes)>bug
Description
Steps to reproduce (6.2, 6.x and master):
- create an index
curl -XPUT localhost:9200/index
- call cluster health with
wait_for_active_shardsset toall
curl 'localhost:9200/_cluster/health?wait_for_active_shards=all&pretty'
An IllegalStateException is returned as part of the response, the status code is 500:
{
"error" : {
"root_cause" : [
{
"type" : "illegal_state_exception",
"reason" : "not enough information to resolve to shard count"
}
],
"type" : "illegal_state_exception",
"reason" : "not enough information to resolve to shard count"
},
"status" : 500
}
The error comes from https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/support/ActiveShardCount.java#L131 , reading from its javadocs "This method should only be invoked with ActiveShardCount objects created from from(int), or NONE or ONE". We are calling it though with ALL .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Distributed/AllocationAll issues relating to the decision making around placing a shard (both master logic & on the nodes)All issues relating to the decision making around placing a shard (both master logic & on the nodes)>bug
Type
Fields
Give feedbackNo fields configured for issues without a type.