Skip to content

Conversation

@pchila
Copy link
Member

@pchila pchila commented Nov 27, 2025

What is the problem this PR solves?

This PR handles new available_rollbacks field sent by elastic-agent during checkin (implemented in PR elastic/elastic-agent#11143).
This information will be consumed by the Fleet UI to allow a manual rollback of recently upgraded agents.

How does this PR solve the problem?

This PR introduces new available_rollbacks field both in CheckinRequest and pendingT structs as a slice of AvailableRollbacks and a JSON array of objects respectively.

How to test this PR locally

Refer to PR elastic/elastic-agent#11143 How to test this PR locally section.

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

@pchila pchila self-assigned this Nov 27, 2025
@pchila pchila added enhancement New feature or request Team:Elastic-Agent Label for the Agent team backport-skip Skip notification from the automated backport with mergify Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Nov 27, 2025
@pchila pchila linked an issue Nov 27, 2025 that may be closed by this pull request
@pchila pchila force-pushed the support-agent-manual-rollback branch from 529235c to 68867ee Compare December 1, 2025 08:28
@pchila pchila marked this pull request as ready for review December 1, 2025 13:37
@pchila pchila requested a review from a team as a code owner December 1, 2025 13:37
rawComp []byte
seqno sqn.SeqNo
unhealthyReason *[]string
rawAvailableRollbacks []byte
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure this was RFCed but could this be part of upgrade meta? like scheduled_at or error_msg so we don't pollute root object with upgrade specific stuff?

Copy link
Contributor

Choose a reason for hiding this comment

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

i imagine you don't need this info outside of upgrade window anyways

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if you are referring to the checkin request body, the validatedCheckin struct or the ES document structure.

The main reason that I didn't mix this information with existing upgrade stuff is that there are assumptions about upgrade details and I didn't know if there are more around other other upgrade fields.

The information about available rollbacks must survive beyond the duration of a single upgrade (and fleet detects the conclusion of an upgrade by the upgrade_details field disappearing in the checkin body) and it's also not a stable intrinsic characteristic of agent so that it can go in something like local_metadata.

The RFC will be updated with the final schema we are gonna have in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify enhancement New feature or request skip-changelog Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rollback field to actionUpgrade

2 participants