Correctly ignore system indices when validating dot-prefixed indices#128868
Correctly ignore system indices when validating dot-prefixed indices#128868masseyke merged 15 commits intoelastic:mainfrom
Conversation
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.
|
Pinging @elastic/es-data-management (Team:Data Management) |
|
Hi @dakrone, I've created a changelog YAML for you. |
| body: {foo: bar} | ||
|
|
||
| - do: | ||
| async_search.submit: |
There was a problem hiding this comment.
So this test fails before the addition to DotPrefixValidator?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I've updated the test so that it fails without this fix.
|
Pinging @elastic/es-distributed (Team:Distributed) |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ 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 overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
kingherc
left a comment
There was a problem hiding this comment.
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.
...ot-prefix-validation/src/test/java/org/elasticsearch/validation/DotPrefixValidatorTests.java
Outdated
Show resolved
Hide resolved
...ot-prefix-validation/src/test/java/org/elasticsearch/validation/DotPrefixValidatorTests.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Iraklis Psaroudakis <kingherc@gmail.com>
* 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)
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
DotPrefixValidatornow correctly receives aSystemIndicesinstance and uses thefindMatchingDescriptorandfindMatchingDataStreamDescriptormethods to determine whether a system index is being referenced. When a matching descriptor is found, the warning emission is skipped.