ES|QL index resolution on planning is broken #127347
Labels
:Analytics/ES|QL
AKA ESQL
>bug
medium-risk
An open issue or test failure that is a medium risk to future releases
Team:Analytics
Meta label for analytical engine team (ESQL/Aggs/Geo)
Currently, ES|QL index resolution works like this:
ignore_unavailable=true
(which means unknown indices and other such errors are ignored)Verification
error.NoClustersToSearchException
This causes various issues:
Further comment from @dnhatn:
I took a look at the issue and I think there are several problems:
There is a disparity in the
indices
option between the field-caps API (planning time) and the search-shards API (runtime). We useALLOW_UNAVAILABLE_TARGETS
for field-caps andERROR_WHEN_UNAVAILABLE_TARGETS
for search-shards. This leads to cases where field-caps does not return failures, but the runtime does. Withallow_partial_results
, we then ignore the runtime failures and return partial results instead of failing the request.We do not strictly check the index failures returned by the field-caps API.
Another issue is related to security exceptions. Since we use
ALLOW_UNAVAILABLE_TARGETS
in the field-caps API, it returnsunknown index
if users lack the privilege to access it. However, if multiple index patterns are specified, we return anunauthorized
error from the runtime instead (seeEsqlSecurityIT
).There are cases where we return a 400 error, and others where we return a 404.
The text was updated successfully, but these errors were encountered: