Skip to content

Correctly ignore system indices when validating dot-prefixed indices#128868

Merged
masseyke merged 15 commits intoelastic:mainfrom
dakrone:dot-prefix-ignore-system-indices
Apr 8, 2026
Merged

Correctly ignore system indices when validating dot-prefixed indices#128868
masseyke merged 15 commits intoelastic:mainfrom
dakrone:dot-prefix-ignore-system-indices

Conversation

@dakrone
Copy link
Copy Markdown
Member

@dakrone dakrone commented Jun 3, 2025

Prior to this change, the (incorrect) assumption was that threadContext.isSystemContext() returned true when dealing with system indices. This was eventually revealed to be false (though there is a separate issue where we aren't emitting deprecation warnings when running locally, but that is a separate thing).

To fix this, the DotPrefixValidator now correctly receives a SystemIndices instance and uses the findMatchingDescriptor and findMatchingDataStreamDescriptor methods to determine whether a system index is being referenced. When a matching descriptor is found, the warning emission is skipped.

Prior to this change, the (incorrect) assumption was that `threadContext.isSystemContext()` returned
true when dealing with system indices. This was eventually revealed to be false (though there is a
separate issue where we aren't emitting deprecation warnings when running locally, but that is a
separate thing).

To fix this, the `DotPrefixValidator` now correctly receives a `SystemIndices` instance and uses the
`findMatchingDescriptor` and `findMatchingDataStreamDescriptor` methods to determine whether a
system index is being referenced. When a matching descriptor is found, the warning emission is
skipped.
@dakrone dakrone added >bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. v9.1.0 v9.0.3 labels Jun 3, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Jun 3, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @dakrone, I've created a changelog YAML for you.

body: {foo: bar}

- do:
async_search.submit:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this test fails before the addition to DotPrefixValidator?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm… I thought that it would, but it doesn't appear to work. So I can remove this test. I'm not sure how to test this right now other than manual testing. I'll do some more digging to see how best to test this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the test so that it fails without this fix.

@dakrone dakrone added :Distributed/Indices APIs Index CRUD APIs, rollover, shrink, split, clone, open, close. and removed :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. labels Jan 21, 2026
@dakrone dakrone added Team:Distributed Meta label for distributed team. and removed Team:Data Management (obsolete) DO NOT USE. This team no longer exists. labels Feb 13, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

Copy link
Copy Markdown
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@masseyke masseyke changed the title Correctly ignore system indices when validationg dot-prefixed indices Correctly ignore system indices when validating dot-prefixed indices Apr 7, 2026
Copy link
Copy Markdown
Contributor

@kingherc kingherc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. You could optionally think about a serverless PR with a .yml REST stateless test that asserts an exception is thrown for dot-prefixed non-system indices.

masseyke and others added 2 commits April 8, 2026 07:51
@masseyke masseyke merged commit 4e6953c into elastic:main Apr 8, 2026
35 checks passed
szybia added a commit to szybia/elasticsearch that referenced this pull request Apr 8, 2026
* upstream/main:
  Mute org.elasticsearch.xpack.esql.expression.function.aggregate.FirstDocIdGroupingAggregatorFunctionTests testSimple elastic#145923
  Reindex relocation: store source TaskResult at destination node (elastic#145488)
  Bump versions after 9.2.8 release
  [CI] DLMFrozenTransitionServiceTests testCheckForFrozenIndicesReturnsEarlyWhenCapacityExhausted failing [elastic#145778] (elastic#145906)
  Update branches.json for 9.2.8 release
  ESQL: Clarify inheriting from Attributes (elastic#145898)
  Bump versions after 9.3.3 release
  Update branches.json for 9.3.3 release
  Prune changelogs after 8.19.14 release
  Bump versions after 8.19.14 release
  Update branches.json for 8.19.14 release
  [ML] Call old inference API (elastic#145690)
  ESQL: Unmute CsvIT sumWithOverflowRow (elastic#145893)
  Index a document when testing runtime fields shadowing dimensions & metrics (elastic#145882)
  [TEST] Fix version check in testSequenceNumbersDisabled (elastic#145879)
  [ESQL] Per-file filter pushdown awareness (elastic#145755)
  Unmute testGetReindexFollowsRelocation (elastic#145841)
  Correctly ignore system indices when validating dot-prefixed indices (elastic#128868)
  [Transform] Remove tests for deleted code (elastic#145685)
  ESQL: Add generative tests for LIMIT BY (elastic#144238)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed/Indices APIs Index CRUD APIs, rollover, shrink, split, clone, open, close. Team:Distributed Meta label for distributed team. v9.0.9 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants