Skip to content
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

[ILM] Add searchable snapshot field #83783

Merged
merged 59 commits into from
Dec 7, 2020

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Nov 19, 2020

Summary

Fix #83505

Adds functionality for configuring searchable snapshots in the policy UI.

How to test

  1. Start ES with a repo path configured, like: yarn es snapshot -E path.repo=/tmp/es-snaps
  2. Start Kibana (yarn start), go to the "Management" in Kibana and open "Index Lifecycle Policies"
  3. Go to create a new policy
  4. Enable "Cold phase" and you should see searchable snapshots, but disabled due to license
  5. Upload an enterprise license to Elasticsearch and refresh until searchable snapshot is usable in cold (i.e., the toggle appears)
  6. Configure searchable snapshot in cold - (optional) you should see a prompt about not having any repositories, follow the instructions to create one use the path you used when you started ES.
  7. Give the policy a name and save
  8. Open the policy you just created and this time open the advanced settings section in the hot phase and enable searchable snapshots
  9. There should be a message about subsequent actions being disabled - this has an effect through the entire form of removing certain fields, like the ability to set searchable snapshot further down in cold (verify this by going to the cold section and seeing that it is now disabled with a callout).
  10. Save the policy, re-open it and check that everything was stored correctly.

Notes

  • copied functionality from pre-existing "wait for snapshot policy field"

Screenshots

Hot phase

New collapsed with "advanced settings" section

Screenshot 2020-12-02 at 12 46 18

Searchable snapshots disabled in advanced settings

Screenshot 2020-12-02 at 12 47 50

Searchable snapshots enabled in hot phase with no repository created and information callout

Screenshot 2020-12-02 at 12 47 16
Cold phase

disabled due to license

Screenshot 2020-12-02 at 12 52 16

enabled in cold

Screenshot 2020-12-02 at 12 53 06
Gif

SS-field

Release note

The ILM policy UI now supports configuring searchable snapshot in the cold phase and in the hot phase.

Checklist

Delete any items that are not applicable to this PR.

@jloleysens jloleysens added release_note:enhancement Feature:ILM v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.11.0 labels Nov 19, 2020
@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

kibanamachine and others added 4 commits November 20, 2020 04:19
- removed nested EuiFieldRow components in data allocation field
- added SCSS files for data allocation field and searchable
  snapshot field
@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

>
{i18n.translate('xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotCalloutBody', {
defaultMessage:
'Force merge, shrink, freeze and searchable snapshots are not allowed when this action is enabled in the hot phase.',

Choose a reason for hiding this comment

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

Suggested change
'Force merge, shrink, freeze and searchable snapshots are not allowed when this action is enabled in the hot phase.',
'Force merge, shrink, and freeze are not allowed when searchable snapshots are enabled in the hot phase.',

Choose a reason for hiding this comment

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

The toggle itself indicates Use searchable snapshots, which I believe is "this action" in the description. If that's the case, then I think we can remove the first mention of searchable snapshots and replace "this action" with "searchable snapshots".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review here :). We still need to communicate that the searchable snapshot action in cold will also be disabled/disallowed - which what the origin "searchable_snapshot" text was trying to communicate 😄

Choose a reason for hiding this comment

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

Will we use the same message for both hot/cold phase?

Will the message for searchable snapshots in the cold phase be conditional on the setting in the hot phase? For example, if searchable snapshots are disabled in the hot phase and users are enabling this setting only in the cold phase, it seems odd to show them a message about enabling searchable snapshots in the hot phase.

Similarly, if enabled in the hot phase, we should show a different message in the cold phase indicating why searchable snapshots are disabled.

Enabled in hot phase, disabled in cold

Hot phase
[ x ] Create searchable snapshot

Force merge, shrink, and freeze are not allowed when searchable snapshots are enabled in the hot phase. Also, searchable snapshots will be disabled in the cold phase.

Cold phase
[ ] Create searchable snapshot

Searchable snapshots are disabled in the cold phase when already enabled in the hot phase.

Disabled in hot phase, enabled in cold

Hot phase
[ ] Create searchable snapshot

Cold phase
[ x ] Create searchable snapshot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will we use the same message for both hot/cold phase?

This particular message only applies to setting searchable snapshot in the hot phase. Happy to add the additional message per your recommendation.

Choose a reason for hiding this comment

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

I think it depends on how the UI responds. When the user enables searchable snapshots in the hot phase, will the ability to enable them in the cold phase be greyed out or made unavailable (not displayed)? If the former, I think it might be helpful for users to know why that option is greyed out. We mention in the searchable snapshots description in the hot phase that snapshots will be disabled in the cold phase, but users could miss that mention.

I could go either way on this one, but I'm trying to think through the UX from the user's standpoint. If we remove the option for enabling searchable snapshots in the cold tier when that option is enabled in the hot tier, then users wouldn't have to question the option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah totally, I agree. I have updated the PR description with some new screenshots for the "disabled" version of the control in cold phase (it is a callout instead of just a disabled control).

'data-test-subj': 'searchableSnapshotToggle',
label: i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotsToggleLabel',
{ defaultMessage: 'Use searchable snapshot' }

Choose a reason for hiding this comment

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

Suggested change
{ defaultMessage: 'Use searchable snapshot' }
{ defaultMessage: 'Create searchable snapshot' }

Choose a reason for hiding this comment

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

Users are creating and mounting the searchable snapshot, so I think that Create is more accurate here than Use.

{i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotFieldDescription',
{
defaultMessage: 'Take a snapshot of the index and mount it as a searchable snapshot.',

Choose a reason for hiding this comment

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

I think that a bit more context here is useful.

Take a snapshot of the managed index in the selected repository and mount it as a searchable snapshot. Learn more

Where Learn more links to the searchable snapshots page: https://github.com/elastic/elasticsearch/blob/master/docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc

Copy link

@lockewritesdocs lockewritesdocs left a comment

Choose a reason for hiding this comment

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

Added some suggested changes that are mostly clarifications. Happy to review again when this PR emerges from the draft state.

@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@jloleysens
Copy link
Contributor Author

@myasonik Thanks for taking a look! We are in the process of working through design feedback so things may yet change a little bit.

I think adding a11y test coverage merits having it's own PR since this one has already grown considerably and we'd probably want to do any further work on this in follow up PRs.

@mdefazio
Copy link
Contributor

mdefazio commented Dec 3, 2020

Here's some feedback, mostly around the callouts:
As discussed, we want to move the activate/deactivate switches for the features to the left so they're consistent with our EuiDescribedFormRows. I'm guessing this can be done in a separate PR though.

Cold snapshot:
(Before)
image

In the case of the cold snapshot, I would still keep the switch, but disable it. Then we can use a s callout with only a title (Cannot perform searchable snapshot in cold when it is configured in hot phase.) --> I don't think 'Snapshot is disabled' is necessary if the switch itself is disabled. I also don't think we need an icon here.

(After)
image

Hot snapshot:

image

  • Remove icon in the callouts: I don't think they add that much context.
  • Do we need a way for the user to create another repository even if they have some created already? In which case, maybe 'Create repository' copy line can be above the callout/below the repository input.
  • Should the repository input be a single option combobox? So I can then see the repositories I have and search as well.
  • It might also be good to stack the callouts on the left (per EUI guidelines :) ). See screenshot of this below.

image

Can then also include the 'no repos' text in the combo box:
image

Happy to discuss these further and which are necessary for this PR and which make sense for future ones.

@cjcenizal
Copy link
Contributor

@mdefazio I mentioned in #83783 (comment) that the "Some actions have been disabled" callout seems overly prominent to me, considering that the user could happily and safely proceed through the form without ever reading that information. What are your thoughts on that?

@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@jloleysens
Copy link
Contributor Author

Thanks for the review @mdefazio

As discussed, we want to move the activate/deactivate switches for the features to the left so they're consistent with our EuiDescribedFormRows. I'm guessing this can be done in a separate PR though.

We can definitely do this in a follow up PR!

Do we need a way for the user to create another repository even if they have some created already? In which case, maybe 'Create repository' copy line can be above the callout/below the repository input.

Yes we do. I thought the following alternative to a callout would work well:

Screenshot 2020-12-04 at 13 49 46

Should the repository input be a single option combobox? So I can then see the repositories I have and search as well.

Yes, this needs to be a single option.

It might also be good to stack the callouts on the left (per EUI guidelines :) ). See screenshot of this below.

I'd like to address this in a follow up PR as it will affect another field too.

Can then also include the 'no repos' text in the combo box...

This is really cool, which prop do we use on the combo box for his?

…fields

* 'master' of github.com:elastic/kibana:
  [ILM] Fix delete phase serialization bug (elastic#84870)
  chore(NA): removes auto install of pre-commit hook (elastic#83566)
  chore(NA): upgrade node-sass into last v4.14.1 to stop shipping old node-gyp (elastic#84935)
  [Alerting] Enables AlertTypes to define the custom recovery action groups (elastic#84408)
  [ML] Functional tests - add missing test data cleanup (elastic#84998)
  Migrate privilege/role/user-related operations to a new Elasticsearch client. (elastic#84641)

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer_and_serializer.test.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts
@mdefazio
Copy link
Contributor

mdefazio commented Dec 4, 2020

Thanks for making the edits. I'm good with tackling the items you mentioned in separate PRs.

One minor ask: Let's avoid using the help text for as many things as we are here:
image

I'm good with going back to using a callout below to mention there are no snapshot repos found (similar to how you're doing it elsewhere as we discussed).

@cjcenizal In regards to the prominence of the callout for items being disabled, one idea might be to move it to a tooltip after the switch—I'm not sure if this goes too far in hiding it though.

In regards to this:

The "Enterprise license required" callout seems like it could be located in the right column, replacing the "Create searchable snapshot" switch. Similar to how CCR handles the absence of remote clusters

I think this will solve itself in follow-up PRs when the switches are moved to the left side as is typical with EuiDescribedFormRows. I agree with you that the callout should be where the action is to turn it on—but this should be on the left side below the feature title + description.

Here is a layout including some of this, but I believe most of this will be done in a follow-up PR. I will approve this one per the discussion with JL to make sure we can merge this and start tackling things in smaller chunks.

image

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

Approving with the understanding that minor polish items (and accessibility edits) will be done in smaller, follow-up PRs.

@ryankeairns
Copy link
Contributor

Looking good!

I would suggest creating an issue(s) to track the feedback items that are being proposed for a follow-up PR. There's been some nice suggestions here, and it can be difficult to sort back through the thread later. Thanks

@jloleysens
Copy link
Contributor Author

jloleysens commented Dec 4, 2020 via email

@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@jloleysens jloleysens merged commit 34be1e7 into elastic:master Dec 7, 2020
@jloleysens jloleysens deleted the ilm/snapshot-fields branch December 7, 2020 09:52
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 7, 2020
* Added server-side endpoint for getting list of repos

* part one of client side changes: added searchable snapshot field

- added to both hot and cold
- serializing into JSON payload

* make searchable snapshot field toggleable and require value when it is being used

* fix typo in file name and remove whitespace

* added searchable snapshot state context, wip

* finished updating fields to show and hide based on searchable snapshot in the hot phase

* hiding fields when searchable snapshots is enabled in hot

- removed nested EuiFieldRow components in data allocation field
- added SCSS files for data allocation field and searchable
  snapshot field

* added translations and a first hot phase serialization test

* appease type check and i18n

* added cloud-specific behaviour for searchable snapshot default inlc. test

* refactor snapshot state -> configuration issues as this a can be re-used for other issues

* added configuration context file

* hide replicas in cold if snapshotting

* updated new field copy

* update test coverage, test for hiding certain fields too

* added license check to client side!

* moved warning to below field again and moved hot phase searchable snapshot notice to right

* make described form field lazy if needed

* render field even when license requirement is not met

* update serializer for removing searchable_snapshot field

* handle 404 from ES when looking up * snapshot repos - we return an empty array

* address license TODO

* added tests for license check and removed license check HoC

* fix legacy jest tests

* added readme about legacy tests

* updated jest tests and fix type issues

* remove unused import

* refactor component names to have "Field" at the end

* refactor searchable snapshot to single interface def and add comment about force_merge_index option

* address stakeholder feebdack and pr comments

* update tests after latest changes

* link to force merge

* Revert "link to force merge"

This reverts commit 6c714fb.

* introduce advanced section to hot, warm and cold

* added test for correctly deserializing delete phase, and added fix

* remove unused variable

* moved fields into advanced settings

* move learn more copy below enable toggle

* fix warm phase on rollover default

* remove label space above rollover toggle

* remove unused import

* update test after fixing warm on rollover default

* removed icons in callouts in searchable snapshot field, added ability to control field toggles

* move callouts to description text

* readd warning callouts to the searchable snapshot field

* slight i18n adjustment

* made callout for actions disabled a bit smaller

* fix i18n

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
jloleysens added a commit that referenced this pull request Dec 7, 2020
* Added server-side endpoint for getting list of repos

* part one of client side changes: added searchable snapshot field

- added to both hot and cold
- serializing into JSON payload

* make searchable snapshot field toggleable and require value when it is being used

* fix typo in file name and remove whitespace

* added searchable snapshot state context, wip

* finished updating fields to show and hide based on searchable snapshot in the hot phase

* hiding fields when searchable snapshots is enabled in hot

- removed nested EuiFieldRow components in data allocation field
- added SCSS files for data allocation field and searchable
  snapshot field

* added translations and a first hot phase serialization test

* appease type check and i18n

* added cloud-specific behaviour for searchable snapshot default inlc. test

* refactor snapshot state -> configuration issues as this a can be re-used for other issues

* added configuration context file

* hide replicas in cold if snapshotting

* updated new field copy

* update test coverage, test for hiding certain fields too

* added license check to client side!

* moved warning to below field again and moved hot phase searchable snapshot notice to right

* make described form field lazy if needed

* render field even when license requirement is not met

* update serializer for removing searchable_snapshot field

* handle 404 from ES when looking up * snapshot repos - we return an empty array

* address license TODO

* added tests for license check and removed license check HoC

* fix legacy jest tests

* added readme about legacy tests

* updated jest tests and fix type issues

* remove unused import

* refactor component names to have "Field" at the end

* refactor searchable snapshot to single interface def and add comment about force_merge_index option

* address stakeholder feebdack and pr comments

* update tests after latest changes

* link to force merge

* Revert "link to force merge"

This reverts commit 6c714fb.

* introduce advanced section to hot, warm and cold

* added test for correctly deserializing delete phase, and added fix

* remove unused variable

* moved fields into advanced settings

* move learn more copy below enable toggle

* fix warm phase on rollover default

* remove label space above rollover toggle

* remove unused import

* update test after fixing warm on rollover default

* removed icons in callouts in searchable snapshot field, added ability to control field toggles

* move callouts to description text

* readd warning callouts to the searchable snapshot field

* slight i18n adjustment

* made callout for actions disabled a bit smaller

* fix i18n

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexLifecycleManagement 111 137 +26

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
indexLifecycleManagement 214.4KB 239.8KB +25.4KB

Distributable file count

id before after diff
default 46898 47663 +765

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
indexLifecycleManagement 76.6KB 77.3KB +747.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ILM release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Searchable Snapshot configuration to Hot and Cold phases of ILM UI
9 participants