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

[Enterprise Search] Search Apps. - fetch indices one-by-one #156571

Merged

Conversation

sloanelybutsurely
Copy link

@sloanelybutsurely sloanelybutsurely commented May 3, 2023

Summary

fetches a search application's indices' stats one at a time.

if even one index is not available the stats api returns an error1. while fetching them all together is probably more efficient we have to get them one-by-one just in case one isn't available.

Checklist

Footnotes

  1. stats errors response
    {
      "error": {
        "root_cause": [
          {
            "type": "index_not_found_exception",
            "reason": "no such index [sloane-books-001]",
            "resource.type": "index_or_alias",
            "resource.id": "sloane-books-001",
            "index_uuid": "_na_",
            "index": "sloane-books-001"
          }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index [sloane-books-001]",
        "resource.type": "index_or_alias",
        "resource.id": "sloane-books-001",
        "index_uuid": "_na_",
        "index": "sloane-books-001"
      },
      "status": 404
    }
    

@sloanelybutsurely sloanelybutsurely added release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.8.0 v8.9.0 labels May 3, 2023
@sloanelybutsurely sloanelybutsurely requested a review from a team May 3, 2023 15:23
Copy link
Member

@kderusso kderusso 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 taking care of this!

@sloanelybutsurely
Copy link
Author

⏸️ ope! similar issues with pages fetching fields caps. more fixes incoming 🔧

@sloanelybutsurely
Copy link
Author

@kderusso made some pretty significant changes to accommodate a similar change to search app field capabilities. mind taking another look?

Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 398 401 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 478 481 +3
total +5

History

  • 💔 Build #125296 failed b89d75e68db2317d16e518174bc3061dfcdb8615
  • 💔 Build #125275 failed 8ff3897df10701f31689088a74a5d24f68f7113e
  • 💚 Build #125225 succeeded 7fe70a2c66f781ffd74c88f25068af7da13ac0dc

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

@sloanelybutsurely sloanelybutsurely merged commit 23a45bd into elastic:main May 3, 2023
@sloanelybutsurely sloanelybutsurely deleted the search-app-indices-errors branch May 3, 2023 20:40
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 3, 2023
…156571)

## Summary

fetches a search application's indices' stats one at a time.

if even one index is not available the stats api returns an error[^1].
while fetching them all together is probably more efficient we have to
get them one-by-one just in case one isn't available.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

[^1]: <details><summary>stats errors response</summary>
    <pre>
    {
      "error": {
        "root_cause": [
          {
            "type": "index_not_found_exception",
            "reason": "no such index [sloane-books-001]",
            "resource.type": "index_or_alias",
            "resource.id": "sloane-books-001",
            "index_uuid": "_na_",
            "index": "sloane-books-001"
          }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index [sloane-books-001]",
        "resource.type": "index_or_alias",
        "resource.id": "sloane-books-001",
        "index_uuid": "_na_",
        "index": "sloane-books-001"
      },
      "status": 404
    }
    </pre>
</details>

(cherry picked from commit 23a45bd)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 3, 2023
…56571) (#156624)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Enterprise Search] Search Apps. - fetch indices one-by-one
(#156571)](#156571)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sloane
Perrault","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-03T20:39:53Z","message":"[Enterprise
Search] Search Apps. - fetch indices one-by-one (#156571)\n\n##
Summary\r\n\r\nfetches a search application's indices' stats one at a
time.\r\n\r\nif even one index is not available the stats api returns an
error[^1].\r\nwhile fetching them all together is probably more
efficient we have to\r\nget them one-by-one just in case one isn't
available.\r\n\r\n### Checklist\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n[^1]:
<details><summary>stats errors response</summary>\r\n <pre>\r\n {\r\n
\"error\": {\r\n \"root_cause\": [\r\n {\r\n \"type\":
\"index_not_found_exception\",\r\n \"reason\": \"no such index
[sloane-books-001]\",\r\n \"resource.type\": \"index_or_alias\",\r\n
\"resource.id\": \"sloane-books-001\",\r\n \"index_uuid\": \"_na_\",\r\n
\"index\": \"sloane-books-001\"\r\n }\r\n ],\r\n \"type\":
\"index_not_found_exception\",\r\n \"reason\": \"no such index
[sloane-books-001]\",\r\n \"resource.type\": \"index_or_alias\",\r\n
\"resource.id\": \"sloane-books-001\",\r\n \"index_uuid\": \"_na_\",\r\n
\"index\": \"sloane-books-001\"\r\n },\r\n \"status\": 404\r\n }\r\n
</pre>\r\n</details>","sha":"23a45bde21b36be49a1174b9bde1fc340de67534","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.8.0","v8.9.0"],"number":156571,"url":"https://github.com/elastic/kibana/pull/156571","mergeCommit":{"message":"[Enterprise
Search] Search Apps. - fetch indices one-by-one (#156571)\n\n##
Summary\r\n\r\nfetches a search application's indices' stats one at a
time.\r\n\r\nif even one index is not available the stats api returns an
error[^1].\r\nwhile fetching them all together is probably more
efficient we have to\r\nget them one-by-one just in case one isn't
available.\r\n\r\n### Checklist\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n[^1]:
<details><summary>stats errors response</summary>\r\n <pre>\r\n {\r\n
\"error\": {\r\n \"root_cause\": [\r\n {\r\n \"type\":
\"index_not_found_exception\",\r\n \"reason\": \"no such index
[sloane-books-001]\",\r\n \"resource.type\": \"index_or_alias\",\r\n
\"resource.id\": \"sloane-books-001\",\r\n \"index_uuid\": \"_na_\",\r\n
\"index\": \"sloane-books-001\"\r\n }\r\n ],\r\n \"type\":
\"index_not_found_exception\",\r\n \"reason\": \"no such index
[sloane-books-001]\",\r\n \"resource.type\": \"index_or_alias\",\r\n
\"resource.id\": \"sloane-books-001\",\r\n \"index_uuid\": \"_na_\",\r\n
\"index\": \"sloane-books-001\"\r\n },\r\n \"status\": 404\r\n }\r\n
</pre>\r\n</details>","sha":"23a45bde21b36be49a1174b9bde1fc340de67534"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156571","number":156571,"mergeCommit":{"message":"[Enterprise
Search] Search Apps. - fetch indices one-by-one (#156571)\n\n##
Summary\r\n\r\nfetches a search application's indices' stats one at a
time.\r\n\r\nif even one index is not available the stats api returns an
error[^1].\r\nwhile fetching them all together is probably more
efficient we have to\r\nget them one-by-one just in case one isn't
available.\r\n\r\n### Checklist\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n[^1]:
<details><summary>stats errors response</summary>\r\n <pre>\r\n {\r\n
\"error\": {\r\n \"root_cause\": [\r\n {\r\n \"type\":
\"index_not_found_exception\",\r\n \"reason\": \"no such index
[sloane-books-001]\",\r\n \"resource.type\": \"index_or_alias\",\r\n
\"resource.id\": \"sloane-books-001\",\r\n \"index_uuid\": \"_na_\",\r\n
\"index\": \"sloane-books-001\"\r\n }\r\n ],\r\n \"type\":
\"index_not_found_exception\",\r\n \"reason\": \"no such index
[sloane-books-001]\",\r\n \"resource.type\": \"index_or_alias\",\r\n
\"resource.id\": \"sloane-books-001\",\r\n \"index_uuid\": \"_na_\",\r\n
\"index\": \"sloane-books-001\"\r\n },\r\n \"status\": 404\r\n }\r\n
</pre>\r\n</details>","sha":"23a45bde21b36be49a1174b9bde1fc340de67534"}}]}]
BACKPORT-->

Co-authored-by: Sloane Perrault <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants