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

[ML] Fix not blocking forced downgrades/installation if cannot delete indices #159814

Merged
merged 5 commits into from Jun 21, 2023

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Jun 15, 2023

Summary

Currently, doing a forced downgrade of a package requires deletion of the transform's destination index. However, it's possible that the kibana_system user does not have sufficient permission to do the deletion of the index for certain indices.

This PR uses the new parameter to also enable deletion . With this change, the destination index is deleted together with the transform regardless of whether the destination index was created by the transform or by the user.

Before:

Example 1 (Dest index is a system index. Does not fail for reinstallation)

Screen.Recording.2023-06-20.at.13.15.48.mov

Example 2 (Dest index is a not system index. Fail for reinstallation)

Screen.Recording.2023-06-20.at.13.20.02.mov

After:

Example 1 (Dest index is a system index. Does not fail for reinstallation)

Screen.Recording.2023-06-20.at.13.23.47.mov

Example 2 (Dest index is a not system index. Does not fail for reinstallation)

Screen.Recording.2023-06-20.at.14.56.17.mov

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@qn895 qn895 added bug Fixes for quality problems that affect the customer experience :ml Team:Fleet Team label for Observability Data Collection Fleet team v8.9.0 labels Jun 15, 2023
@qn895 qn895 self-assigned this Jun 15, 2023
@qn895 qn895 force-pushed the ml-fleet-fix-not-blocking-downgrades branch from b0f209a to 806ecb4 Compare June 15, 2023 15:28
@qn895 qn895 marked this pull request as ready for review June 20, 2023 16:52
@qn895 qn895 requested a review from a team as a code owner June 20, 2023 16:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@qn895 qn895 added the v8.8.2 label Jun 20, 2023
{ transform_id: transformId },
{ ignore: [404] }
);
await esClient.transform.getTransform({ transform_id: transformId }, { ignore: [404] });
Copy link
Member

Choose a reason for hiding this comment

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

What the point of that call now? as we ignore 404 it seems to check the transform exists

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch! Removed here 656dd9d (#159814)

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

One small questions but otherwise LGTM 🚀

@qn895 qn895 force-pushed the ml-fleet-fix-not-blocking-downgrades branch from 656dd9d to 431f516 Compare June 20, 2023 20:41
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #55 / cloud_security_posture GET internal/cloud_security_posture/rules/_find Should return 200 status code and filter rules by benchmarkId

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 13 15 +2
securitySolution 411 415 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 14 16 +2
securitySolution 494 498 +4
total +6

History

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

cc @qn895

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM ⚡

@qn895 qn895 merged commit 7686163 into elastic:main Jun 21, 2023
24 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 21, 2023
@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

qn895 pushed a commit that referenced this pull request Jun 22, 2023
…delete indices (#159814) (#160089)

Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
fix",":ml","Team:Fleet","v8.9.0","v8.8.2"],"number":159814,"url":"#159814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience :ml release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v8.8.2 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants