You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elasticsearch version (bin/elasticsearch --version): 7.5.1
Plugins installed: []
JVM version (java -version):
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)
OS version (uname -a if on a Unix-like system):
Linux deathstar 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Current Behavior:
When index.blocks.read_only is set to true, _bulk requests to that index return OK 200
Expected Behavior:
Elasticsearch returns FORBIDDEN 403 when a _bulk request is performed against an index with index.blocks.read_only set to true as they do when cluster.blocks.read_only is set or what single document inserts do in both scenarios.
Impact: This kind of behaviors make managing elasticsearch unnecessarily harder. While it is tricky to decide which status code needs to be returned on a _bulk response, it does make sense to return the worst possible one and between 200 and 403, 403 seems like a clear candidate.
The text was updated successfully, but these errors were encountered:
PereBal
changed the title
Indices with index.blocks.read_only set to true return CREATED (HTTP-201) on _bulk requests
Indices with index.blocks.read_only set to true return OK (HTTP-200) on _bulk requests
Mar 2, 2020
There is no HTTP response code that means exactly the right thing here, so every choice is a compromise. We have as a team settled on 200 OK for bulk requests successfully processed by the coordinating node, even if some or all of the individual items do not succeed (see e.g. #28522 (comment) and #29169 (comment)). We recognise that this means that clients cannot use the status code of the overall response to react appropriately to failures of bulk requests, but there are too many cases where a different status code would also result in the wrong reaction. Choosing the "worst possible" code doesn't really work, even where it is well-defined. It turns out to be simpler for all concerned if we uniformly ask clients always to look at the status of each item in a bulk response as we do today.
Bug report
Elasticsearch version (
bin/elasticsearch --version
): 7.5.1Plugins installed: []
JVM version (
java -version
):openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)
OS version (
uname -a
if on a Unix-like system):Linux deathstar 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Current Behavior:
When
index.blocks.read_only
is set to true,_bulk
requests to that index returnOK 200
Expected Behavior:
Elasticsearch returns
FORBIDDEN 403
when a_bulk
request is performed against an index withindex.blocks.read_only
set to true as they do whencluster.blocks.read_only
is set or what single document inserts do in both scenarios.Steps to reproduce:
Impact: This kind of behaviors make managing elasticsearch unnecessarily harder. While it is tricky to decide which status code needs to be returned on a
_bulk
response, it does make sense to return the worst possible one and between 200 and 403, 403 seems like a clear candidate.The text was updated successfully, but these errors were encountered: