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
{{ message }}
Repository navigation
[BUG] HTTP status code changed on 2.3.0 on querying for non-existing index #851
HTTP/1.1 400 Bad Request
{
"error": {
"reason": "Error occurred in OpenSearch engine: no such index [non-existed]",
"details": "org.opensearch.index.IndexNotFoundException: no such index [non-existed]\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.",
"type": "IndexNotFoundException"
},
"status": 404
}
2.3.0:
HTTP/1.1 503 Service Unavailable
{
"error": {
"reason": "Error occurred in OpenSearch engine: no such index [non-existed]",
"details": "org.opensearch.index.IndexNotFoundException: no such index [non-existed]\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.",
"type": "IndexNotFoundException"
},
"status": 404
}
Payloads are same, but status codes are different.
Thanks for reporting this issue! This is probably because the approach of getting index mapping is changed. Previously the code on each OpenSearch node just read status in ClusterState object locally. In this way, we can avoid blocking operation during parsing, analyzing and planning and make all running on NIO thread. However, this is changed to calling OpenSearch API due to some other issue.
I found similar issue in metrics. In legacy engine, index not found is treated as client error. However, the issue reported here cause it treated as server error in v2 engine which may cause wrong alarm in monitor system from user side.
Activity
dai-chen commentedon Sep 21, 2022
Thanks for reporting this issue! This is probably because the approach of getting index mapping is changed. Previously the code on each OpenSearch node just read status in
ClusterStateobject locally. In this way, we can avoid blocking operation during parsing, analyzing and planning and make all running on NIO thread. However, this is changed to calling OpenSearch API due to some other issue.Previously index not found exception is thrown and handled by https://github.com/opensearch-project/sql/blob/2.2/legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java#L165 in NIO thread. Now it's thrown from worker thread and handled by https://github.com/opensearch-project/sql/blob/2.2/legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSQLQueryAction.java#L177 without
isClientErrorcheck. We may need to check here as we move everything to worker thread.acarbonetto commentedon Sep 28, 2022
Test skipped for change:
sql/sql-cli/tests/test_opensearch_connection.py
Line 42 in 63c5137
dai-chen commentedon Feb 8, 2023
I found similar issue in metrics. In legacy engine, index not found is treated as client error. However, the issue reported here cause it treated as server error in v2 engine which may cause wrong alarm in monitor system from user side.