Certain shard failure response no longer contains error property #54235
Labels
>bug
:Search/Search
Search-related issues that do not fall into other categories
Team:Search
Meta label for search team
team-discuss
This effects 7.7.0+
This is a pretty particular error to hit, so I am assuming the regression was not intentional. It appears that for an invalid scripted field, it is failing only one of the shards and skipping the rest which is resulting in a hits response instead of an error.
This change broke a test we had in Kibana, preventing the promotion of our nightly snapshot. Looking for guidance on if this is an accidental regression or we should update our checks accordingly.
Here is the minimum reproduction I could come up with:
cURL friendly commands
curl -XPUT "http://localhost:9200/test-1" -H 'Content-Type: application/json' -d'{ "settings": { "number_of_shards": 1 }, "mappings": { "properties": { "@timestamp": { "type": "date" } } }}'
curl -XPUT "http://localhost:9200/test-2" -H 'Content-Type: application/json' -d'{ "settings": { "number_of_shards": 1 }, "mappings": { "properties": { "@timestamp": { "type": "date" } } }}'
curl -XPOST "http://localhost:9200/test-*/_search" -H 'Content-Type: application/json' -d'{ "version": true, "size": 500, "sort": [ { "@timestamp": { "order": "desc", "unmapped_type": "boolean" } } ], "script_fields": { "invalid_scripted_field": { "script": { "source": "invalid", "lang": "painless" } } }, "query": { "bool": { "must": [], "filter": [ { "match_all": {} }, { "range": { "@timestamp": { "gte": "2020-03-25T20:26:57.120Z", "lte": "2020-03-25T20:41:57.120Z", "format": "strict_date_optional_time" } } } ] } }}'
This failed search attempt is returning
_shards
andhits
, where the only mention of a failure is within the_shards.failures
.Compare this to the previous behavior, where the response was an
error
with aroot_cause
andfailed_shards
:The text was updated successfully, but these errors were encountered: