-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Upgrade Assistant] Better handling of closed indices #58890
[Upgrade Assistant] Better handling of closed indices #58890
Conversation
Using _cluster/state is considered internal. This adds an integration test for checking the contract in CI.
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
Updated the handling of reindexOptions to make it more backwards compatible (treat it as if it could be undefined). Also update the logic for checking for open or closed indices. No optional chaining! It should break if the response does not exactly match.
Rather check for the specific value we want, as this is what is also gauranteed by the tests. In this way, the information we send back to the client is also more accurate regarding the index status. If, in future, more index states are introduced this will need to be revisited if it affects the ability for an index to be re-indexed.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
"openAndClose" should just happen automatically. The user should not have to pass the flag in, that would be a weird API. We just need to warn the user about that reindexing a closed index will take more resources
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 makings those changes! I left one copy suggestion, but nothing blocking.
...sistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/container.tsx
Outdated
Show resolved
Hide resolved
Reindexing test was generating index name, could just get it from server response. Also removed openAndClose from all integration tests
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Exclude disallowed, private setting at index creation * Remove intl from tabs component * Added logic for checking the current index status * Added ES contract integration test Using _cluster/state is considered internal. This adds an integration test for checking the contract in CI. * Add the client side notification for closed indices * First version of end-to-end functionality working * Clean up unused, incorrect type information * Fix type issues and added a comment about the new reindex options * Fixed server side tests, added comments and logic updates Updated the handling of reindexOptions to make it more backwards compatible (treat it as if it could be undefined). Also update the logic for checking for open or closed indices. No optional chaining! It should break if the response does not exactly match. * Clean up unused code * Improved idempotency of test and check explicitly for "close". Rather check for the specific value we want, as this is what is also gauranteed by the tests. In this way, the information we send back to the client is also more accurate regarding the index status. If, in future, more index states are introduced this will need to be revisited if it affects the ability for an index to be re-indexed. * Update client-side tests * Fix types * Handle a case where the index name provided may be an alias * Fix types * merge-conflict: finish merge conflict resolution * Update x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/closed_warning_icon.tsx Co-Authored-By: Alison Goryachev <[email protected]> * merge-conflict: Remove duplicate import VSCode does not auto-save as expected :sigh: * ui: Revisit the UI Moved the warning icon to inside of the button and tooltip to on the button. Added a callout to the reindex flyout for when an index is closed. * logic: slight update to when the index closed callout is shown We only show the index closed callout in the flyout when the reindex operation is not considered "completed" * tests: fix jest tests * refactor: remove "openAndClose" from reindex endpoints "openAndClose" should just happen automatically. The user should not have to pass the flag in, that would be a weird API. We just need to warn the user about that reindexing a closed index will take more resources * test: update upgrade assistant integration test * fix: types * copy: use sentence case * refactor: use the in scope declaration of reindex op * test: Clean up tests Reindexing test was generating index name, could just get it from server response. Also removed openAndClose from all integration tests Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Alison Goryachev <[email protected]> # Conflicts: # x-pack/plugins/upgrade_assistant/common/types.ts # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.test.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/button.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.test.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/container.tsx # x-pack/plugins/upgrade_assistant/server/lib/__snapshots__/es_migration_apis.test.ts.snap # x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts
* master: (22 commits) Generate docs from data plugin (elastic#56955) Fixes elastic#59513 by hiding one of the symmetric edges rather than omiting it (elastic#59514) Harden creation of child processes (elastic#55697) [Alerting] replace watcher http APIs used by index threshold Alerting (elastic#59475) [Maps][docs] add more details to Quantitative data driven styling docs (elastic#59553) chore: 🤖 hide Drilldowns in master (elastic#59698) [Discover] Migrate AppState/GlobalState to new app state helpers (elastic#57175) Use HTTP request schemas to create types, use those types in the client (elastic#59340) [Maps] Support categorical styling for numbers and dates (elastic#57908) [ML] Functional API tests - bucket span estimation with custom search.max_buckets (elastic#59665) Fix slm_ui setting by changing camel case back to snake case. (elastic#59663) removes beta tag (elastic#59618) [DOCS] Removed spatial references (elastic#59595) fix outdated docs (elastic#58729) [ML] Fixes bucket span estimators loading of max_buckets setting (elastic#59639) [ML] Refactoring anomaly detector job types (elastic#59556) [Upgrade Assistant] Better handling of closed indices (elastic#58890) additional visualizations plugin cleanup before moving to NP (elastic#59318) In scripted fields, unable to switch the `Type` - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (elastic#59285) [Visualize] Remove global state in visualize (elastic#58352) ...
…s/kibana into alerting/fix-flaky-instance-test * 'alerting/fix-flaky-instance-test' of github.com:gmmorris/kibana: (176 commits) Generate docs from data plugin (elastic#56955) Fixes elastic#59513 by hiding one of the symmetric edges rather than omiting it (elastic#59514) Harden creation of child processes (elastic#55697) [Alerting] replace watcher http APIs used by index threshold Alerting (elastic#59475) [Maps][docs] add more details to Quantitative data driven styling docs (elastic#59553) chore: 🤖 hide Drilldowns in master (elastic#59698) [Discover] Migrate AppState/GlobalState to new app state helpers (elastic#57175) Use HTTP request schemas to create types, use those types in the client (elastic#59340) [Maps] Support categorical styling for numbers and dates (elastic#57908) [ML] Functional API tests - bucket span estimation with custom search.max_buckets (elastic#59665) Fix slm_ui setting by changing camel case back to snake case. (elastic#59663) removes beta tag (elastic#59618) [DOCS] Removed spatial references (elastic#59595) fix outdated docs (elastic#58729) [ML] Fixes bucket span estimators loading of max_buckets setting (elastic#59639) [ML] Refactoring anomaly detector job types (elastic#59556) [Upgrade Assistant] Better handling of closed indices (elastic#58890) additional visualizations plugin cleanup before moving to NP (elastic#59318) In scripted fields, unable to switch the `Type` - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (elastic#59285) [Visualize] Remove global state in visualize (elastic#58352) ...
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
…59650) * [Upgrade Assistant] Better handling of closed indices (#58890) * Exclude disallowed, private setting at index creation * Remove intl from tabs component * Added logic for checking the current index status * Added ES contract integration test Using _cluster/state is considered internal. This adds an integration test for checking the contract in CI. * Add the client side notification for closed indices * First version of end-to-end functionality working * Clean up unused, incorrect type information * Fix type issues and added a comment about the new reindex options * Fixed server side tests, added comments and logic updates Updated the handling of reindexOptions to make it more backwards compatible (treat it as if it could be undefined). Also update the logic for checking for open or closed indices. No optional chaining! It should break if the response does not exactly match. * Clean up unused code * Improved idempotency of test and check explicitly for "close". Rather check for the specific value we want, as this is what is also gauranteed by the tests. In this way, the information we send back to the client is also more accurate regarding the index status. If, in future, more index states are introduced this will need to be revisited if it affects the ability for an index to be re-indexed. * Update client-side tests * Fix types * Handle a case where the index name provided may be an alias * Fix types * merge-conflict: finish merge conflict resolution * Update x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/closed_warning_icon.tsx Co-Authored-By: Alison Goryachev <[email protected]> * merge-conflict: Remove duplicate import VSCode does not auto-save as expected :sigh: * ui: Revisit the UI Moved the warning icon to inside of the button and tooltip to on the button. Added a callout to the reindex flyout for when an index is closed. * logic: slight update to when the index closed callout is shown We only show the index closed callout in the flyout when the reindex operation is not considered "completed" * tests: fix jest tests * refactor: remove "openAndClose" from reindex endpoints "openAndClose" should just happen automatically. The user should not have to pass the flag in, that would be a weird API. We just need to warn the user about that reindexing a closed index will take more resources * test: update upgrade assistant integration test * fix: types * copy: use sentence case * refactor: use the in scope declaration of reindex op * test: Clean up tests Reindexing test was generating index name, could just get it from server response. Also removed openAndClose from all integration tests Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Alison Goryachev <[email protected]> # Conflicts: # x-pack/plugins/upgrade_assistant/common/types.ts # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.test.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/list.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/button.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.test.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx # x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/container.tsx # x-pack/plugins/upgrade_assistant/server/lib/__snapshots__/es_migration_apis.test.ts.snap # x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts * Merge: Resolve remaining merge conflicts Also updated existing Jest snapshots. * test: Update Jest snapshots and reference the 6.0 index The integration test on master is reference 7.0 because it aims toward helping users migrate from 7.0 -> 8.0. The 7.x branch is running 6.0 data as it helps migrate from older indices. * Remove test data 🤦🏼♂️ * Clean up Jest snapshot After removing the test data, this snapshot also needed to be updated Co-authored-by: Elastic Machine <[email protected]>
@jloleysens do I need to start from 5.6.16 to test this PR? Thanks! |
Hi @bhavyarm ! The PR description has a hacky version of to test the UI, but for an actual test we would need to load up a v7.7.0 stack (ES + Kibana) and have the following conditions met:
The upgrade assistant should now be able to both detect the need for reindexing and that the index is closed. Reindexing should still be possible, though. We just want to let the user know that we need to open the index and re-close it. |
Summary
Fix #41572
We use the
_cluster/state
endpoint to determine whether an index is open or closed. We inform the user in the UI but we still allow them to request a reindex with the understanding that the UA will open, reindex, alias and close the index again.How to test
x-pack/plugins/upgrade_assistant/server/lib/es_migration_apis.ts
.test1
,test2
andtest3
actually exist in the cluster. (e.g. in ConsolePUT test1
etc).test1
.POST /test1/_close
(more information on this API here)test1
. There should be an alert icon next to the button with some more information displayed on hover.GET _cluster/state/metadata/test1
and check that thestate
key is stillclose
.test2
, this should work as before and leave the index inopen
state (use same step as above but for indextest2
to verify).Release note
TODO
Additional information
Snippet:
Screenshots
Reindex Button state when index is closed
Flyout state (another callout, see emphasis)
Checklist
Delete any items that are not applicable to this PR.
For maintainers