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 shrink field to hot phase #84087

Merged

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Nov 23, 2020

Summary

Fix #82879

How to test

  1. Start kibana and go to the index lifecycle management section in the management section
  2. Create a new ILM policy configuring both shrink actions in hot and warm (you will need to activate warm)
  3. Check the policy JSON in the flyout, we should have configuration for shrink in both hot and warm
  4. Save the policy
  5. Return to the policy and make sure the settings that were set before are presented in the same way

Open questions

  • Do we want to warn users about configuring a shrink action in warm that has a higher number than in hot?

Screenshots

Screenshot 2020-11-23 at 15 19 32

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 23, 2020
@jloleysens jloleysens requested a review from a team as a code owner November 23, 2020 14:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

id="xpack.indexLifecycleMgmt.editPolicy.shrinkIndexExplanationText"
defaultMessage="Shrink the index into a new index with fewer primary shards."
/>{' '}
<LearnMoreLink docPath="indices-shrink-index.html#indices-shrink-index" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I know the docs link was there before, but this page seems to work better for this context, wdyt?
https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-shrink.html

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Hi @jloleysens , nice work adding shrink support to hot phase! I tested locally and the policy editor worked. I have only 2 suggestions to improve in this PR but not blocking:

  • I noticed that shared fields have inconsistent names: Forcemerge, SetPriorityInput, MinAgeInputField, ShrinkField. I think it would make sense to keep a consistent naming convention, for example have everything end with Field since also files are named this way.
  • To your open question: I think it would make sense to at least warn the user about warm phase having a larger number of shards than hot phase. I tested with an index starting with 5 shards, hot phase shrinks to 1 shard and then warm phase fails while trying to 'shrink' to 5 shards (see attached screenshot).

Screenshot 2020-11-23 at 17 21 24

…k-field-to-hot-phase

* 'master' of github.com:elastic/kibana: (429 commits)
  simplify popover open state logic (elastic#85379)
  [Logs UI][Metrics UI] Move actions to the kibana header (elastic#84648)
  [Search Source] Do not pick scripted fields if * provided (elastic#85133)
  [Search] Session SO polling (elastic#84225)
  [Transform] Replace legacy elasticsearch client (elastic#84932)
  [Uptime]Refactor header and action menu (elastic#83779)
  Fix agg select external link (elastic#85380)
  [ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled (elastic#85292)
  clear using keyboard (elastic#85042)
  [GS] add tag and dashboard suggestion results (elastic#85144)
  [ML] API integration tests - skip GetAnomaliesTableData
  Add ECS field for event.code. (elastic#85109)
  [Functional][TSVB] Wait for markdown textarea to be cleaned (elastic#85128)
  skip flaky suite (elastic#62060)
  skip flaky suite (elastic#85098)
  Bump highlight.js to v9.18.5 (elastic#84296)
  Add `server.publicBaseUrl` config (elastic#85075)
  [Alerting & Actions ] More debug logging (elastic#85149)
  [Security Solution][Case] Manual attach alert to a case (elastic#82996)
  Loosen UUID regex to accept uuidv1 or uuidv4 (elastic#85338)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts
#	x-pack/plugins/index_lifecycle_management/server/routes/api/policies/register_create_route.ts
@yuliacech
Copy link
Contributor

Hi @jloleysens , I had a look at your updates to this PR since the last review and changes LGTM!
I'll create an issue for UX improvements of shrink action to keep track of:

  • warn the user when warm phase has a larger number of shards then the hot phase
  • add a help text to the input field that the number of shards needs to be a factor of the number of the existing shards

Anyways, I'm good with merging this when CI is green! 🎉

@jloleysens jloleysens merged commit dbd14ad into elastic:master Dec 10, 2020
@jloleysens jloleysens deleted the ilm/add-shrink-field-to-hot-phase branch December 10, 2020 09:50
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 10, 2020
* moved shrink field to shared_fields and added it to the hot phase

* updated test

* update legacy jest test

* removed configuration context for now

* remove unused i18n and remove duplicated isRolloverEnabled check;

* fixed shrink field to use new described field component

* added test for removing shrink field in serialization and re-ordered fields in hot phase advanced
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 10, 2020
* master: (53 commits)
  Fixing recovered instance reference bug (elastic#85412)
  Switch to new elasticsearch client for Visualizations (elastic#85245)
  Switch to new elasticsearch client for TSVB (elastic#85275)
  Switch to new elasticsearch client for Vega (elastic#85280)
  [ILM] Add shrink field to hot phase (elastic#84087)
  Add rolling-file appender to core logging (elastic#84735)
  [APM] Service overview: Dependencies table (elastic#83416)
  [Uptime ]Update empty message for certs list (elastic#78575)
  [Graph] Fix graph saved object references (elastic#85295)
  [APM] Create new API's to return Latency and Throughput charts (elastic#85242)
  [Advanced settings] Reset to default for empty strings (elastic#85137)
  [SECURITY SOLUTION] Bundles _source -> Fields + able to sort on multiple fields in Timeline (elastic#83761)
  [Fleet] Update agent listing for better status reporting (elastic#84798)
  [APM] enable 'sanitize_field_names' for Go (elastic#85373)
  Update dependency @elastic/charts to v24.4.0 (elastic#85452)
  Introduce external url service (elastic#81234)
  Deprecate disabling the security plugin (elastic#85159)
  [FLEET] New Integration Policy Details page for use in Integrations section (elastic#85355)
  [Security Solutions][Detection Engine] Fixes one liner access control with find_rules REST API
  chore: 🤖 remove extraPublicDirs (elastic#85454)
  ...
jloleysens added a commit that referenced this pull request Dec 10, 2020
* moved shrink field to shared_fields and added it to the hot phase

* updated test

* update legacy jest test

* removed configuration context for now

* remove unused i18n and remove duplicated isRolloverEnabled check;

* fixed shrink field to use new described field component

* added test for removing shrink field in serialization and re-ordered fields in hot phase advanced
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexLifecycleManagement 138 139 +1

Async chunks

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

id before after diff
indexLifecycleManagement 244.2KB 245.2KB +963.0B

Distributable file count

id before after diff
default 46981 47741 +760

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 support for shrink action in ILM policy hot phase
4 participants