Skip to content

MB-72535: Cap leaf term searchers per index per search - #2387

Merged
Samsonnyyeet merged 1 commit into
masterfrom
MB-72535
Aug 6, 2026
Merged

MB-72535: Cap leaf term searchers per index per search#2387
Samsonnyyeet merged 1 commit into
masterfrom
MB-72535

Conversation

@Samsonnyyeet

@Samsonnyyeet Samsonnyyeet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Add MaxTermSearchersKey: count every leaf term searcher (at the single choke point newTermSearcherFromReader) and fail the search once the count exceeds the limit.

The cap is per leaf index, not global: within a single index it spans the whole query tree, but across an IndexAlias each index is counted independently, so the effective ceiling scales with the number of indexes.

Unlike DisjunctionMaxClauseCount, which is enforced per fan-out node, this bounds the total across a single index's query tree rather than at any one node.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 52.363% (+0.04%) from 52.323% — MB-72535 into master

Comment thread search/term_limit.go Outdated
Comment thread search/term_limit.go Outdated
Comment thread search/term_limit_test.go Outdated
Comment thread term_limit_integration_test.go Outdated
@capemox

capemox commented Aug 4, 2026

Copy link
Copy Markdown
Member

@Samsonnyyeet is bleveMaxTerms supposed to be global (for the whole search request) or per leaf index? It looks like it's the latter, and you should change the commit message to be explicit about this.

Add MaxTermSearchersKey: count every leaf term searcher and fail the
search once the count exceeds the limit.

The cap is per leaf index, not global: it spans the whole query tree
within a single index, but across an IndexAlias each index is counted
independently.
@Samsonnyyeet Samsonnyyeet changed the title MB-72535: Cap total leaf term searchers per search MB-72535: Cap leaf term searchers per index per search Aug 4, 2026
@Samsonnyyeet
Samsonnyyeet merged commit 4cc468f into master Aug 6, 2026
10 checks passed
@Samsonnyyeet
Samsonnyyeet deleted the MB-72535 branch August 6, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants