-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Should Elasticsearch return a non-200 response if there are shard failures? #18978
Comments
Please no.
This would cause all of the clients to report an exception instead of returning partial results. This is not ideal, eg I'd rather see some results than none at all. Given that there isn't an HTTP status that indicates partial success, I vote to keep it as 200 |
This is something that bugged me in the past as well, but I do not feel too strongly about it since we give users all the information they need to do whathever they want to do on application side (raise an error, show a big red warning that there is a partial failure, etc.). I am a bit torn as to whether it would be worth maitaining a parameter or setting for this. So I think I am leaning towards 1. |
+1 to 1 . So sad we don’t have a partial response status code.
|
207 is a partial response code but it is all mixed up with WebDAV.... I still think it'd be much more intuitive to return a non-200 and have the client check if the request looks like a partial failure rather than a complete one.... I know we don't check it all the right places in our tests. |
ES only sends a non-200 response all shards fail but we should fail the tests generated by docs if any of them fail. Depending on the outcome of elastic#18978 this might be a temporary workaround.
This is IMHO, a poor design decision and goes against a fail-fast system. |
@TheGreatYamcha this is intentional, eg we'd rather show you some of your friends' updates instead of none. The response includes the |
This was added after all as boolean query parameter |
The |
Lots of Elasticsearch tasks are forked onto a bunch of shards. When those shards fail, Elasticsearch returns the failures in the json at
_shards.failures
including the HTTP response code that that failure deserves but it will return an HTTP 200 response code so long as a single shard succeeds. I think it should return a non-200 HTTP status if any shard fails.Do we want to:
failures
array in the response. We could also talk about RFC 4918's207 Multi-Status
but at first glance that specifies some XML response we aren't going to implement.The text was updated successfully, but these errors were encountered: