Skip to content

[9.0] Avoid unnecessary determinization in index pattern conflict checks#128759

Merged
elasticsearchmachine merged 1 commit intoelastic:9.0from
jimczi:backport_128362
Jun 2, 2025
Merged

[9.0] Avoid unnecessary determinization in index pattern conflict checks#128759
elasticsearchmachine merged 1 commit intoelastic:9.0from
jimczi:backport_128362

Conversation

@jimczi
Copy link
Contributor

@jimczi jimczi commented Jun 2, 2025

Backport of #128362 to 9.0

…lastic#128362)

Starting with Lucene 10, `CharacterRunAutomaton` is no longer determinized automatically.
In Elasticsearch 9, we adapted to this by eagerly determinizing automatons early (via `Regex#simpleMatchToAutomaton`).
However, this introduced  regression: operations like index template conflict checks, which only require intersection testing, now pay the cost of determinization—an expensive step that wasn’t needed before. In some cases, especially when many wildcard patterns are involved, determinization can even fail due to state explosion.

This change removes the unnecessary determinization, restoring the pre-9.0 behavior and allowing valid index templates with many patterns to be registered again.
@jimczi jimczi added >bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v9.0.3 labels Jun 2, 2025
@elasticsearchmachine elasticsearchmachine merged commit 5a94245 into elastic:9.0 Jun 2, 2025
16 checks passed
@jimczi jimczi deleted the backport_128362 branch June 2, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. v9.0.3

2 participants