-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Closed
Labels
:Search Foundations/SearchCatch all for Search FoundationsCatch all for Search Foundations>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineers
Description
Elasticsearch Version
main
Installed Plugins
No response
Java Version
bundled
OS Version
all
Problem Description
I discovered this while working on #106325.
Executing the following yaml test succeeds, which means requesting _seq_no via fields returns a 5xx error.
---
fetch _seq_no via fields:
- do:
catch: "request"
search:
index: test
body:
fields: [ _seq_no ]
# This should be `unauthorized` (401) or `forbidden` (403) or at least `bad request` (400)
# while instead it is mapped to an `internal_server_error (500)`
- match: { status: 500 }
- match: { error.root_cause.0.type: unsupported_operation_exception }
- match: { error.root_cause.0.reason: "Cannot fetch values for internal field [_seq_no]." }
This happens because in the fetch phase (FetchFieldsPhase) we try to use the SeqNoFieldMapper ValueFetcher which throws an UnsupportedOperationException. I think this is the case for other metadata fields too...all those throwing such exception.
Notice that the same issue does not happen if we request _seq_no via stored_fields because StoredFieldPhase does not use ValueFetcher to retrieve field values.
Steps to Reproduce
Just execute the yaml test against main
Logs (if relevant)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search Foundations/SearchCatch all for Search FoundationsCatch all for Search Foundations>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineers