Skip to content

Queries with many automata can quickly lead to OOM errors #87024

@ywelsch

Description

@ywelsch

Queries using many Lucene automatons can quickly run OOM, as each automaton takes substantial amount of memory. We had a user with a bool query that had 2000 wildcard subqueries, each of which was matching on a long string, resulting in a 6GB+ in-memory representation of all automata. There are other variations of this problem (e.g. bool query with many subclauses that are doing fuzziness, or regexp matching).

We would ideally have a way to approximate memory usage up-front here and fail the query early before letting the node run into OOMs.

Metadata

Metadata

Assignees

Labels

:Search Foundations/SearchCatch all for Search Foundations>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearchpriority:highA label for assessing bug priority to be used by ES engineersresiliency

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions