-
Notifications
You must be signed in to change notification settings - Fork 195
Preserve upgrade marker when rolling back and add rollback reason to upgrade details #8407
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
Conversation
This pull request does not have a backport label. Could you fix it @pchila? 🙏
|
This pull request is now in conflicts. Could you fix it? 🙏
|
5e3129c
to
2121c28
Compare
6531e40
to
394dcc6
Compare
This pull request is now in conflicts. Could you fix it? 🙏
|
91ba418
to
83c694e
Compare
Add some unit tests for watchCmd function, covering the most common cases. This has required some refactoring to properly assert side effects and interactions.
23c0f74
to
ad6365a
Compare
Not sure why lint is still failing since the Edit: |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
💚 Build Succeeded
History
cc @pchila |
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 all the testing, this was helpful to me
Modifications introduced with elastic#8407 should have fixed the timing issue that made TestStandaloneUpgradeRollbackOnRestarts flaky on windows
Modifications introduced with elastic#8407 should have fixed the timing issue that made TestStandaloneUpgradeRollbackOnRestarts flaky on windows
Modifications introduced with elastic#8407 should have fixed the timing issue that made TestStandaloneUpgradeRollbackOnRestarts flaky on windows
Modifications introduced with elastic#8407 should have fixed the timing issue that made TestStandaloneUpgradeRollbackOnRestarts flaky on windows
Modifications introduced with #8407 should have fixed the timing issue that made TestStandaloneUpgradeRollbackOnRestarts flaky on windows
Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407
* Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION
…34711) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java
…34711) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java
…34711) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java
…134752) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java Co-authored-by: Paolo Chilà <[email protected]>
…134749) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java Co-authored-by: Paolo Chilà <[email protected]>
…134750) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java Co-authored-by: Paolo Chilà <[email protected]>
…134751) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java Co-authored-by: Paolo Chilà <[email protected]>
…34711) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION
…34711) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION
…34711) (elastic#134751) * Add Reason field to elastic-agent upgrade details metadata Add "reason" text field to map a new upgrade details field introduced in PR elastic/elastic-agent#8407 * Update docs/changelog/134711.yaml * Bump FLEET_AGENTS_MAPPINGS_VERSION (cherry picked from commit 67676ae) # Conflicts: # x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java Co-authored-by: Paolo Chilà <[email protected]>
What does this PR do?
A new
reason
string field has been added in UpgradeDetails struct. Such field should contain a human-readable description of the cause of the last state transition.In the specific case this is used to distinguish how elastic-agent got to the
UPG_ROLLBACK
state: the only possible reason at the moment is an automatic rollback initiated by the elastic-agent watcher, but this could be used for any state transitionWhy is it important?
This PR will allow to to distinguish if the cause of an
UPG_ROLLBACK
status is:Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog toolDisruptive User Impact
How to test this PR locally
Kill/restart the updated agent 3 times during the grace period
Check that the agent rolls back to the starting version
Verify that now a new
reason
field is present in upgrade details metadata:elastic-agent status
commandGET kbn:/api/fleet/agents/7a0ac237-9e82-49ac-bb0d-a2a9edac0ead
if it's a managed agent:Related issues
Questions to ask yourself