Skip to content

[Index Management] Remove _cat/indices API from server code#122867

Merged
yuliacech merged 13 commits intoelastic:mainfrom
yuliacech:index_management_remove_cat
Jan 28, 2022
Merged

[Index Management] Remove _cat/indices API from server code#122867
yuliacech merged 13 commits intoelastic:mainfrom
yuliacech:index_management_remove_cat

Conversation

@yuliacech
Copy link
Contributor

@yuliacech yuliacech commented Jan 12, 2022

Fixes #57286
Fixes #90565 (skipped api integration test)

Summary

This PR refactors server side code of indices list route so that it doesn't rely on _cat/indices API. There should not be any visual or functional regressions in the Indices tab of Index Management.

How to test

Note: We need to wait until elastic/elasticsearch#81954 is in the ES snapshot build for CI tests to pass and to be able to run yarn es snapshot and test locally.

  1. Start ES with yarn es snapshot
  2. Start Kibana with yarn start
  3. Navigate to Index Management -> Indices and check that indices information in the table is correct (Toggle "include hidden indices" to show more indices)
  4. Create an index in Dev Tools Console with
POST /test_index/_doc
{
  "test": "test"
}
  1. In Index Management, open "test_index" details flyout and change its settings: number of shards and replicas, open/close the index and check that this information is correctly updated in the table.
  2. Add more documents to "test_index" by running the same _doc request a couple of times
POST /test_index/_doc
{
  "test": "test"
}

Check that index size and docs number is updated in the table.

@yuliacech yuliacech added Feature:Index Management Index and index templates UI 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 t// technical debt Improvement of the software architecture and operational architecture v8.1.0 labels Jan 12, 2022
@yuliacech yuliacech marked this pull request as ready for review January 12, 2022 19:22
@yuliacech yuliacech requested a review from a team as a code owner January 12, 2022 19:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @yuliacech! I've tested this using yarn es source and couldn't find any regressions introduced by these changes.

The only thing I found was unrelated, and its that we show the manage index actions dropdown to users without checking for permissions first. For example, all system indices actions are not allowed for the superuser role and fail with a 403 error. I've created the following issue for tracking this #123446

primary: indexData.settings?.index?.number_of_shards,
replica: indexData.settings?.index?.number_of_replicas,
documents: indexStats?.total?.docs?.count ?? 0,
size: new ByteSizeValue(indexStats?.total?.store?.size_in_bytes ?? 0).toString(),
Copy link
Member

Choose a reason for hiding this comment

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

TIL about ByteSizeValue !

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech yuliacech enabled auto-merge (squash) January 28, 2022 17:07
@yuliacech yuliacech added the auto-backport Deprecated - use backport:version if exact versions are needed label Jan 28, 2022
@yuliacech yuliacech merged commit 0274ee8 into elastic:main Jan 28, 2022
@kibana-ci
Copy link

💚 Build Succeeded

Metrics [docs]

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
indexManagement 3 0 -3

History

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

@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jan 28, 2022
@kibanamachine
Copy link
Contributor

💔 Backport failed

The pull request could not be backported due to the following error:
There are no branches to backport to. Aborting.

How to fix

Re-run the backport manually:

node scripts/backport --pr 122867

Questions ?

Please refer to the Backport tool documentation

awahab07 pushed a commit to awahab07/kibana that referenced this pull request Jan 31, 2022
…c#122867)

* [IM] Replace Cat Indices API with Indices Stats API that now return index health and status too

* [IM] Fixed types and updated how primary and replica shards info is calculated

* [IM] Fixed primary and replica numbers and added server side tests

* [IM] Fixed flaky api integration test

* [Index Management] Updated `filter_path` to include necessary index properties

* [ILM] Updated snapshots for extend index management tests

* [IM] Made fetch indices call work with indices missing in stats object

* [IM] Updated the comment about response size

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@yuliacech yuliacech deleted the index_management_remove_cat branch March 7, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed backport:skip This PR does not require backporting Feature:Index Management Index and index templates UI 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 t// technical debt Improvement of the software architecture and operational architecture v8.1.0

Projects

None yet

5 participants