-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Add experimental toggle for enabling doc-value-only indexing to data streams #144357
Comments
Pinging @elastic/fleet (Team:Fleet) |
If I set |
I did run a quick test run and fields.yml
Resulting template:
#145410 implies that the feature is supported, I assume it has been for a while. This is good. During implementation of this issue we must ensure to have logic in place to not overwrite these values if they are set. Something like:
Same applies to doc_values field. |
@kpollich can we update this issue to reflect the remaining work and how the toggle and package spec fields should work together? |
@joshdover - Made some updates to the description above. Let me know if this accurate based on your's and @ruflin's comments above and elsewhere. |
Most important for me is, whoever takes on this task is not just checking the exact spec described in this issue for implementation but checks against Elasticsearch docs what fields are supported, which ones not and why. I want to make sure we don't miss some fields that we forgot to put into the issue or have changed since the issue was written. |
@joshdover @ruflin @kpollich These switches are reversible, right? So if enabled, can they be changed back? |
AFAIK yes. But I assume it requires a rollover to take effect. |
We could add a tooltip or link to the docs to remind the users that rollover is needed. |
There's a dedicated issue for this open: #143448, prioritized for a 2 sprints from now. |
@ruflin @joshdover The docs are a little confusing whether this list is an exhaustive list that supports I am wondering if by date types, do we mean only Later the doc says that I guess I could go through all existing types to check, alternatively check if the mapping type has |
## Summary Closes #144357 WIP. Review can be started, but still requires a lot of testing and fixing the issue below. How to test locally: - Turn on `experimentalDataStreamSettings` feature flag - Go to Add integration, System integration - On the first data stream, turn on the Doc value only switches, Save - The mapping changes are visible under Stack Management / Index Management / Component Templates e.g. `logs-system.auth@package` - The numeric switch sets `index:false` on all numeric field mappings (long, double, etc.) - The other switch sets `index:false` on all other field type mappings that support it (keyword, ip, date, etc.) - The new mappings will take effect after rollover <img width="475" alt="image" src="https://user-images.githubusercontent.com/90178898/213206641-13ead2fc-f079-407c-9c0e-c58f99dd4903.png"> <img width="1037" alt="image" src="https://user-images.githubusercontent.com/90178898/213495546-9962c458-590b-4787-bf2d-9f19abea3f67.png"> What works: - When turning the new doc-value-only numeric and other checkboxes on or off, the corresponding mapping changes are done in the component template - The logic also reads the package spec's template and preserves the `index:false` values regardless of the switch (tested manually by setting `@timestamp` field to `index:false` in the template, there is also the `original` field in `logs-system.auth@package` stream that is set to `index:false` in the package by default. ``` "original": { "index": false, "doc_values": false, "type": "keyword" }, ``` Pending: - Add/update unit and integration tests to verify the mapping change logic - DONE - Manual testing (turning the switches on/off, create/update package policy, upgrade package) - DONE - Clarify TODOs in the code about the supported types - DONE - Hitting an issue when turning on `doc-value-only` for "other" types (keyword, date, etc.). Could be that one of the fields doesn't support `index:false` setting. Didn't experience this when turning on only the numeric types. - FIXED ``` illegal_argument_exception: [illegal_argument_exception] Reason: updating component template [logs-system.auth@package] results in invalid composable template [logs-system.auth] after templates are merged ``` EDIT: found the root cause of this: `Caused by: java.lang.IllegalArgumentException: data stream timestamp field [@timestamp] is not indexed` ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Kibana Machine <[email protected]>
Related to #132818
Leveraging the prework done in #140095, we should add a toggle for "doc-only-value" indexing on a data stream. This should be done by updating the data stream's index template mappings so that every
double
andlong
field hasindex: false
set.Read more on
doc-value-only
fields: https://www.elastic.co/guide/en/elasticsearch/reference/8.1/doc-values.html#doc-value-only-fieldsFleet should provide two experimental toggles for opting data streams into this functionality:
index: false
to all "numeric" (e.g.double
andlong
) mappingsindex: false
to all other compatible fields (keyword
,date
,ip
,boolean
,geo_point
)Each toggle controls the settings for corresponding mappings in the data stream's index template.
At least for testing purposes, having both options would likely be helpful to gauge the storage, indexing, and query performance tradeoffs.
Interaction with
index: false
in package manifestsCurrently, integration developers can provide
index: false
for various fields included in an integrations mappings. If any value is provided for theindex
setting (eithertrue
orfalse
), Fleet must honor it and avoid overwriting the value. The package manifest is the source of truth for all indexing settings.In summary:
index: undefined
for a given field, it may be overridden by the toggle stateindex: true | false
for a given field, it may not be overridden by the toggle stateImplementation
numeric doc-values-only
toggle under the "experimental indexing settings" section of the Fleet policy editorindex: false
for alldouble
andlong
propertiesindex
setting is unset from the index template's mappingsother doc-values-only
toggle under the "experimental indexing settings" section of the Fleet policy editorkeyword
,date
,ip
,boolean
, andgeo_point
fields are updated to provideindex: false
in their settingsindex
value for the above mapping types is unsetindex
settings as provided by the given package's manifestThe text was updated successfully, but these errors were encountered: