[UA] Do not allow reindexing data_stream backing indices (and other enhancements)#213755
Conversation
|
Pinging @elastic/kibana-core (Team:Core) |
74bf706 to
0cd39ab
Compare
Bamieh
left a comment
There was a problem hiding this comment.
Checked the PR again after the more recent changes. LTGM. The migrations file needed some refactoring :elasticheart:
jloleysens
left a comment
There was a problem hiding this comment.
Great work @gsoldevila !! Thanks for restoring the lost behaviour and cleaning up the code a bit, way more readable now 👏🏻
I did not test locally but the logic and re-added copy looks solid. When you get a chance, if you still have this running would you mind adding some screenshots to the PR description of what changed?
| /> | ||
| ); | ||
|
|
||
| expect(wrapper).toMatchInlineSnapshot(` |
There was a problem hiding this comment.
nit: I tried to get this right but I couldn't get the assertions to be against just the data-test-subj attribute (in this case data-test-subj="startIndexReadonlyButton"). I believe there should be a way to say: "I expect data tests subject X to exist".
These snapshots serve that purpose too, they just a bit verbose IMO.
Not something we need to change on this PR though!
| </EuiText> | ||
| ), | ||
| }, | ||
| /* We cannot unfreeze backing indices (that would break the related data_stream) */ |
There was a problem hiding this comment.
| /* We cannot unfreeze backing indices (that would break the related data_stream) */ | |
| /* We cannot reindex backing indices in the same way as regular indices (that would break the related data_stream) */ |
| id="xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.description" | ||
| defaultMessage="Alternatively, you can reindex the data into a new, compatible index. All existing documents will be copied over to a new index, and the old index will be removed. Depending on the size of the index and the available resources, the reindexing operation can take some time. Your data will be in read-only mode until the reindexing has completed." | ||
| /> | ||
| {isClosedIndex && ( |
There was a problem hiding this comment.
Nice! This addresses my concern of showing this warning when the reindex option is not present.
| <EuiFlexItem grow={false}> | ||
| <EuiFlexGroup gutterSize="s"> | ||
| {!hasFetchFailed && !isCompleted && hasRequiredPrivileges && ( | ||
| {/* We cannot unfreeze backing indices (that would break the related data_stream) */} |
There was a problem hiding this comment.
| {/* We cannot unfreeze backing indices (that would break the related data_stream) */} | |
| {/* We cannot reindex backing indices in the same way as regular indices (that would break the related data_stream) */} |
933d08d to
c775fd4
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…nhancements) (elastic#213755) ## Summary The PR brings the following improvements to the UA ES deprecations flows: * Remove the "Reindex" option for _Frozen index_ deprecations that are related to a data stream's backing index (backing indices cannot be alias-based, see [thread](https://elastic.slack.com/archives/C08A04N8XHV/p1741017934359239)). * Propagate `"isClosedIndex"` information to the UI side, so that we can show a warning message in the reindex flows flyouts. The [original functionality](elastic#58890) got lost in the woods. * Propagate `"isClosedIndex", "isFrozenIndex", "isReadonly"` properties as part of the `correctiveAction` details ONLY for _index_settings migrations_, instead of doing it as top level properties for all migrations. These properties did not make for most migration types. * Big refactor in `migrations.ts` file (server side). The logic for obtaining, filtering and enriching ES deprecations had become quite fragmented and hard to read. @Bamieh @jloleysens please take a close look at this one. * Improve existing type definitions. (cherry picked from commit f2ae059)
…other enhancements) (#213755) (#214386) # Backport This will backport the following commits from `8.x` to `8.18`: - [[UA] Do not allow reindexing data_stream backing indices (and other enhancements) (#213755)](#213755) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2025-03-13T13:34:47Z","message":"[UA] Do not allow reindexing data_stream backing indices (and other enhancements) (#213755)\n\n## Summary\n\nThe PR brings the following improvements to the UA ES deprecations\nflows:\n\n* Remove the \"Reindex\" option for _Frozen index_ deprecations that are\nrelated to a data stream's backing index (backing indices cannot be\nalias-based, see\n[thread](https://elastic.slack.com/archives/C08A04N8XHV/p1741017934359239)).\n* Propagate `\"isClosedIndex\"` information to the UI side, so that we can\nshow a warning message in the reindex flows flyouts. The [original\nfunctionality](#58890) got lost in\nthe woods.\n* Propagate `\"isClosedIndex\", \"isFrozenIndex\", \"isReadonly\"` properties\nas part of the `correctiveAction` details ONLY for _index_settings\nmigrations_, instead of doing it as top level properties for all\nmigrations. These properties did not make for most migration types.\n* Big refactor in `migrations.ts` file (server side). The logic for\nobtaining, filtering and enriching ES deprecations had become quite\nfragmented and hard to read. @Bamieh @jloleysens please take a close\nlook at this one.\n* Improve existing type definitions.","sha":"f2ae05909dd81e3cc368173b350b331587a99d8d","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","backport:version","v8.18.0","v8.19.0"],"title":"[UA] Do not allow reindexing data_stream backing indices (and other enhancements)","number":213755,"url":"https://github.com/elastic/kibana/pull/213755","mergeCommit":{"message":"[UA] Do not allow reindexing data_stream backing indices (and other enhancements) (#213755)\n\n## Summary\n\nThe PR brings the following improvements to the UA ES deprecations\nflows:\n\n* Remove the \"Reindex\" option for _Frozen index_ deprecations that are\nrelated to a data stream's backing index (backing indices cannot be\nalias-based, see\n[thread](https://elastic.slack.com/archives/C08A04N8XHV/p1741017934359239)).\n* Propagate `\"isClosedIndex\"` information to the UI side, so that we can\nshow a warning message in the reindex flows flyouts. The [original\nfunctionality](#58890) got lost in\nthe woods.\n* Propagate `\"isClosedIndex\", \"isFrozenIndex\", \"isReadonly\"` properties\nas part of the `correctiveAction` details ONLY for _index_settings\nmigrations_, instead of doing it as top level properties for all\nmigrations. These properties did not make for most migration types.\n* Big refactor in `migrations.ts` file (server side). The logic for\nobtaining, filtering and enriching ES deprecations had become quite\nfragmented and hard to read. @Bamieh @jloleysens please take a close\nlook at this one.\n* Improve existing type definitions.","sha":"f2ae05909dd81e3cc368173b350b331587a99d8d"}},"sourceBranch":"8.x","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
The PR brings the following improvements to the UA ES deprecations flows:
"isClosedIndex"information to the UI side, so that we can show a warning message in the reindex flows flyouts. The original functionality got lost in the woods."isClosedIndex", "isFrozenIndex", "isReadonly"properties as part of thecorrectiveActiondetails ONLY for index_settings migrations, instead of doing it as top level properties for all migrations. These properties did not make for most migration types.migrations.tsfile (server side). The logic for obtaining, filtering and enriching ES deprecations had become quite fragmented and hard to read. @Bamieh @jloleysens please take a close look at this one.Here are screenshots for each of the combinations:
old + open
old + closed
old + frozen + open
old + frozen + closed
old + open + manual write block (readonly)
old + closed + manual write block (readonly)
old + frozen + open + manual write block (readonly)
old + frozen + closed + manual write block (readonly)