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

[Fleet] Update restart agent upgrade action to use upgrade details #171419

Closed
jillguyonnet opened this issue Nov 16, 2023 · 6 comments · Fixed by #173628
Closed

[Fleet] Update restart agent upgrade action to use upgrade details #171419

jillguyonnet opened this issue Nov 16, 2023 · 6 comments · Fixed by #173628
Assignees
Labels
Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@jillguyonnet
Copy link
Contributor

Currently, the condition to check whether an agent is stuck in updating does not make use of the new upgrade details. The logic should be validated and updated accordingly.

@jillguyonnet jillguyonnet added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic juliaElastic self-assigned this Dec 19, 2023
@juliaElastic
Copy link
Contributor

juliaElastic commented Dec 19, 2023

This is a follow up for using upgrade details to determine if an agent is stuck in updating, to enable restart upgrade: #135539 (comment)

@cmacknz Should we enable restart upgrade when upgrade_details.state == 'UPG_FAILED' and status == 'updating' or also when status is back to healthy (status == 'online') and UPG_FAILED?

@cmacknz
Copy link
Member

cmacknz commented Dec 19, 2023

Should we enable restart upgrade when upgrade_details.state == 'UPG_FAILED'

Yes UPG_FAILED is a terminal state for the upgrade, it means it was attempted, failed, and is now finished.

The other valid terminal state is UPG_SUCCESS (or not upgrade details at all because there is no in progress upgrade).

CC @ycombinator in case I missed something here.

@ycombinator
Copy link
Contributor

The other valid terminal state is UPG_SUCCESS (or not upgrade details at all because there is no in progress upgrade).

It's the latter: "not upgrade details at all because there is no in progress upgrade". Fleet will never actually see UPG_SUCCESS.

@juliaElastic
Copy link
Contributor

So to confirm, we want to display the restart upgrade when UPG_FAILED is in upgrade_details, regardless of the main agent status (updating/online), right?

@ycombinator
Copy link
Contributor

ycombinator commented Dec 19, 2023

So to confirm, we want to display the restart upgrade when UPG_FAILED is in upgrade_details, regardless of the main agent status (updating/online), right?

Yes! Sorry, I was just responding to the "in case I missed something here" part of the comment before :)

jlind23 pushed a commit that referenced this issue Dec 21, 2023
…173628)

## Summary

Closes #171419

Added upgrade details check to restart upgrade callout when agent is
stuck in updating.
Changed the copy slightly when the agent has failed upgrade state.

<img width="653" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/50061732-aa92-495b-b683-4d96114a1d5a">

Existing copy when there is no upgrade details (stuck in updating for
more than 2 hours):
<img width="609" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/14413c4a-ce51-49fa-a217-68993c4378fd">

Adjusted Agent list tooltip as well if upgrade details state is failed.

<img width="513" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/6836e02e-2c30-4c0a-91ea-8baddb0ccf03">



### 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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 21, 2023
…lastic#173628)

## Summary

Closes elastic#171419

Added upgrade details check to restart upgrade callout when agent is
stuck in updating.
Changed the copy slightly when the agent has failed upgrade state.

<img width="653" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/50061732-aa92-495b-b683-4d96114a1d5a">

Existing copy when there is no upgrade details (stuck in updating for
more than 2 hours):
<img width="609" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/14413c4a-ce51-49fa-a217-68993c4378fd">

Adjusted Agent list tooltip as well if upgrade details state is failed.

<img width="513" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/6836e02e-2c30-4c0a-91ea-8baddb0ccf03">

### 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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 1f3d3ea)
kibanamachine referenced this issue Dec 21, 2023
…dating (#173628) (#173807)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Fleet] adding upgrade details UPG_FAILED check to stuck in updating
(#173628)](#173628)

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

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

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-12-21T08:06:02Z","message":"[Fleet]
adding upgrade details UPG_FAILED check to stuck in updating
(#173628)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/171419\r\n\r\nAdded upgrade
details check to restart upgrade callout when agent is\r\nstuck in
updating.\r\nChanged the copy slightly when the agent has failed upgrade
state.\r\n\r\n<img width=\"653\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/50061732-aa92-495b-b683-4d96114a1d5a\">\r\n\r\nExisting
copy when there is no upgrade details (stuck in updating for\r\nmore
than 2 hours):\r\n<img width=\"609\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/14413c4a-ce51-49fa-a217-68993c4378fd\">\r\n\r\nAdjusted
Agent list tooltip as well if upgrade details state is
failed.\r\n\r\n<img width=\"513\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/6836e02e-2c30-4c0a-91ea-8baddb0ccf03\">\r\n\r\n\r\n\r\n###
Checklist\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---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"1f3d3eaaa703ddc470ebe3e2e6140cd068434f14","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.12.0","v8.13.0"],"number":173628,"url":"https://github.com/elastic/kibana/pull/173628","mergeCommit":{"message":"[Fleet]
adding upgrade details UPG_FAILED check to stuck in updating
(#173628)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/171419\r\n\r\nAdded upgrade
details check to restart upgrade callout when agent is\r\nstuck in
updating.\r\nChanged the copy slightly when the agent has failed upgrade
state.\r\n\r\n<img width=\"653\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/50061732-aa92-495b-b683-4d96114a1d5a\">\r\n\r\nExisting
copy when there is no upgrade details (stuck in updating for\r\nmore
than 2 hours):\r\n<img width=\"609\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/14413c4a-ce51-49fa-a217-68993c4378fd\">\r\n\r\nAdjusted
Agent list tooltip as well if upgrade details state is
failed.\r\n\r\n<img width=\"513\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/6836e02e-2c30-4c0a-91ea-8baddb0ccf03\">\r\n\r\n\r\n\r\n###
Checklist\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---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"1f3d3eaaa703ddc470ebe3e2e6140cd068434f14"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173628","number":173628,"mergeCommit":{"message":"[Fleet]
adding upgrade details UPG_FAILED check to stuck in updating
(#173628)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/171419\r\n\r\nAdded upgrade
details check to restart upgrade callout when agent is\r\nstuck in
updating.\r\nChanged the copy slightly when the agent has failed upgrade
state.\r\n\r\n<img width=\"653\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/50061732-aa92-495b-b683-4d96114a1d5a\">\r\n\r\nExisting
copy when there is no upgrade details (stuck in updating for\r\nmore
than 2 hours):\r\n<img width=\"609\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/14413c4a-ce51-49fa-a217-68993c4378fd\">\r\n\r\nAdjusted
Agent list tooltip as well if upgrade details state is
failed.\r\n\r\n<img width=\"513\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/6836e02e-2c30-4c0a-91ea-8baddb0ccf03\">\r\n\r\n\r\n\r\n###
Checklist\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---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"1f3d3eaaa703ddc470ebe3e2e6140cd068434f14"}}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants