Skip to content

Handle deleted rollover index exclusions - #1319

Draft
Pybsama wants to merge 1 commit into
block:mainfrom
Pybsama:codex/allow-missing-search-indices
Draft

Handle deleted rollover index exclusions#1319
Pybsama wants to merge 1 commit into
block:mainfrom
Pybsama:codex/allow-missing-search-indices

Conversation

@Pybsama

@Pybsama Pybsama commented Jul 31, 2026

Copy link
Copy Markdown

Why

ElasticGraph caches the concrete indices related to a rollover template. If one
of those indices is then deleted manually, a later range-filtered search can
still include the deleted name as an exclusion in its _msearch index
expression. OpenSearch rejects that request with index_not_found_exception.

What

  • Set ignore_unavailable: true only on _msearch metadata headers whose
    index expression contains exclusions. Unlike allow_no_indices, this option
    ignores a missing concrete target such as the deleted index in an exclusion
    expression, while ordinary positive-index queries retain their existing
    failure behavior.
  • Add a real-datastore regression that caches two monthly rollover indices,
    deletes one, and verifies a range-filtered search still returns the document
    from the remaining index.
  • Add a unit assertion covering both the exclusion header and an adjacent
    ordinary header.

Validation

  • Targeted unit specs: 27 examples, 0 failures.
  • GraphQL unit suite: 1,352 examples, 0 failures.
  • New real-datastore regression on OpenSearch 2.19.0 (with the repository's
    mapper-size and analysis-icu plugins): 1 example, 0 failures.
  • script/lint on all three changed files.
  • script/type_check.
  • script/spellcheck.
  • bundle exec rake schema_artifacts:check.
  • Direct OpenSearch 2.19.0 _msearch verification confirmed the original
    wildcard,-deleted-index expression returns a 404 sub-response with
    allow_no_indices: true and a 200 sub-response with
    ignore_unavailable: true.
  • The new :no_vcr datastore regression is also included in the CI matrix for
    Elasticsearch 9.0/9.4 and OpenSearch 2.19/3.6.

Risk assessment

Low. The change adds an officially supported _msearch metadata option only
when the generated index expression contains exclusions. Ordinary positive
index queries keep their current strict behavior. Index expressions, routing,
request bodies, query grouping, and public APIs are unchanged. The integration
regression preserves a remaining live index, so it also verifies that successful
results are not swallowed.

References

Closes #589.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@myronmarston myronmarston self-assigned this Jul 31, 2026
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.

Use allow_no_indices: true to avoid failures after manually deleted indices

3 participants