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] Delete index_codec option if disabled in UI #87267

Merged

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Jan 5, 2021

Fixes #87219

I could not reproduce on 7.10, so I think this was introduced at some point during the 7.11 release cycle, possibly from #83077.

How to test:

  1. Navigate to ILM and create a policy.
  2. Enable the force merge action for the hot phase. Specify the number of segments and enable the "Compress stored fields" option.
  3. Enable the force merge action for the warm phase. Specify the number of segments and enable the "Compress stored fields" option.
  4. Save the policy.
  5. Reopen the policy and disable the "Compress stored fields" option for both hot and warm phases.
  6. Save the policy.
  7. Reopen the policy and verify the "Compress stored fields" options are disabled.

@alisonelizabeth alisonelizabeth added v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v7.12.0 Feature:ILM labels Jan 5, 2021
@@ -65,6 +65,8 @@ export const createSerializer = (originalPolicy?: SerializedPolicy) => (
delete hotPhaseActions.forcemerge;
} else if (_meta.hot.bestCompression) {
hotPhaseActions.forcemerge!.index_codec = 'best_compression';
} else {
delete hotPhaseActions.forcemerge!.index_codec;
}

if (_meta.hot.bestCompression && hotPhaseActions.forcemerge) {
Copy link
Contributor Author

@alisonelizabeth alisonelizabeth Jan 5, 2021

Choose a reason for hiding this comment

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

I wasn't sure how to test this logic in the UI and if there's any additional changes required here too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it is a bit more tricky to fully test in the UI since we have to interact with the component and submit the form to catch the network request that would have been made and then make assertions against that payload. Kind of like this

In this case I guess we'd make a policy that has this enabled, submit a request, check that it is there, then disable and send the request again. Although that might require wrestling with any routing that happens too.

For now, I think having a unit test for the serialisation is good, since we know the toggle can actually set the value. The trickier (more bug prone) part of the serialiser is removing values that have been unset.

@alisonelizabeth alisonelizabeth marked this pull request as ready for review January 5, 2021 18:30
@alisonelizabeth alisonelizabeth requested a review from a team as a code owner January 5, 2021 18:30
@elasticmachine
Copy link
Contributor

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

@jloleysens
Copy link
Contributor

@elasticmachine merge upstream

@jloleysens
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Great work @alisonelizabeth ! Tested locally and removing codec works.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
indexLifecycleManagement 249.7KB 249.8KB +104.0B

Distributable file count

id before after diff
default 47262 48025 +763

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:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.11.0 v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ILM] Cannot disable index_codec option
4 participants