Description
Elasticsearch Version
9.1.0-SNAPSHOT
Installed Plugins
No response
Java Version
bundled
OS Version
N/A
Problem Description
Open PIT request returns the number of failed shards in the "skipped" field and the number of skipped shards in the "failed" field.
Looks like the bug has been in place since partial search was added to PIT (#111516).
I believe the fix is just to pass values in the correct order here:
Though we also clearly need to fill a gap in testing.
Steps to Reproduce
- Start a 2 node cluster
- Put an index with 2 shards
PUT /test
{
"settings": {
"index": {
"number_of_shards": 2,
"number_of_replicas": 0
}
}
}
- Stop one of the nodes (therefore making a shard unavailable).
- Open a PIT allowing partial search results
POST /test/_pit?keep_alive=1m&allow_partial_search_results=true
-> {
"id": "...",
"_shards": {
"total": 2,
"successful": 1,
"skipped": 1,
"failed": 0
}
}
There should be 1 shard failed, not 1 skipped. For instance, a normal search gives:
GET /test/_search
-> {
"took": 2,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 1,
"skipped": 0,
"failed": 1,
"failures": [
{
"shard": 1,
"index": "test",
"node": null,
"reason": {
"type": "no_shard_available_action_exception",
"reason": null
}
}
]
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits": []
}
}
Logs (if relevant)
No response