-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Allow regular data streams to be migrated to tsdb data streams. #83843
Allow regular data streams to be migrated to tsdb data streams. #83843
Conversation
A regular data stream can be migrated to a tsdb data stream if the `index_mode` field is set to `time_series`. The `index_mode` field can only be update from null to `time_series`. Then on the next rollover the data stream's index mode's is changed from null to time_series and the new backing indices will have `index.mode` index setting set to `time_series` as well. Closes elastic#83520
How to migrate a non tsdb data stream:
|
Pinging @elastic/es-data-management (Team:Data Management) |
I was playing with this but I wasn't able to get it to work, maybe I'm doing something wrong though? Steps:
Even though the routing path setting is in the template (and retrieving the template shows
|
I made it so, that a data stream can only be upgrade if index_mode hasn't been specified before. In your example it has been set to This is a bad error, since it isn't clear what to do here. What I think that I will do is, if the index_mode has been specified in the template and data streams exist with that index mode then changing the index mode shouldn't be allowed. Note that, practicality going from standard to time_series and undefined to time_series is the same, but I prefer to be strict about what migrate path is supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit weird that we treat IndexMode.STANDARD and no index mode as two different settings, since IndexMode.STANDARD is default, but I don't have strong feelings about it. Perhaps with a good error message we can avoid some confusion here. Otherwise, looks good to me form the TSDB perspective.
I think it would be best to support |
Ok, I will change this pr, so that migrating from |
@dakrone I've made the change to also allow data stream migration if index mode is standard. Do you think we should prevent users from changing the Making that change won't effect existing tsdb data streams that match with that template, but it might make users think that it is possible (since we support migration of existing data streams to tsdb data streams by changing the index_mode to time_series). I think it similar to the check we have in |
Thanks! I'll take another look.
I think that for now it would be good to prevent this. It will be much easier to change it later to allow switching away from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding all the tests!
… else if a tsdb data stream still matches with that template
…omething else if a tsdb data stream still matches with that template" This reverts commit 62cc71d.
👍 I will address this in a followup PR. |
* upstream/master: (167 commits) Mute FrozenSearchableSnapshotsIntegTests#testCreateAndRestorePartialSearchableSnapshot Mute LdapSessionFactoryTests#testSslTrustIsReloaded Fix spotless violation from last commit Mute GeoGridTilerTestCase#testGeoGridSetValuesBoundingBoxes_UnboundedGeoShapeCellValues Small formatting clean up (elastic#84144) Always re-run Feature migrations which have encountered errors (elastic#83918) [DOCS] Clarify `orientation` usage for WKT and GeoJSON polygons (elastic#84025) Group field caps response by index mapping hash (elastic#83494) Shrink join queries in slow log (elastic#83914) TSDB: Reject the nested object fields that are configured time_series_dimension (elastic#83920) [DOCS] Remove note about partial response from Bulk API docs (elastic#84053) Allow regular data streams to be migrated to tsdb data streams. (elastic#83843) [DOCS] Fix `ignore_unavailable` parameter definition (elastic#84071) Make Metadata extend AbstractCollection (elastic#83791) Add API specs for OpenID Connect APIs Revert "Clean up for superuser role name references (elastic#83627)" (elastic#84096) Update Lucene analysis base url (elastic#84094) Avoid null threadContext in ResultDeduplicator (elastic#84093) Use static empty store files metadata (elastic#84034) Preserve context in snapshotDeletionListeners (elastic#84089) ... # Conflicts: # x-pack/plugin/rollup/build.gradle
…tic#83843) A regular data stream can be migrated to a tsdb data stream if in template that created the data stream, the `index_mode` field is set to `time_series` and the data stream's `index_mode` property is either not specified or set to `standard`. Then on the next rollover the data stream is migrated to be a tsdb data stream. When that happens the data stream's `index_mode` property is set to `time_series` and the new backing index's `index.mode` index setting is also set to `time_series`. Closes elastic#83520
A regular data stream can be migrated to a tsdb data stream if in template that created the data stream, the
index_mode
field is set totime_series
and the data stream'sindex_mode
property is either not specified or set tostandard
. Then on the next rollover the data stream is migrated to be a tsdb data stream.When that happens the data stream's
index_mode
property is set totime_series
and the new backing index'sindex.mode
index setting is also set totime_series
.Closes #83520