Skip to content

Adding new configuration setting: agent.upgrade.rollback.window #8065

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

Merged
merged 7 commits into from
May 7, 2025

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented May 2, 2025

What does this PR do?

This PR adds a new optional Agent configuration setting, agent.upgrade.rollback.window. This setting takes a string parseable by time.Duration(). The default value of this setting is 168h (== 7 days). The value of this setting will determine how long after users upgrade an Agent will they be permitted to request a rollback to the previous version of the Agent on disk.

Why is it important?

To allow users to perform manual rollbacks of upgraded Elastic Agent within a certain time window.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • 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
  • I have added an integration test or an E2E test

Disruptive User Impact

None; this PR adds a new, optional setting. Further, older versions of Elastic Agent will ignore this setting if they encounter it.

How to test this PR locally

$ echo "agent.upgrade.rollback.window: 12h" >> ./elastic-agent.yml
$ go build .
$ ./elastic-agent inspect    # check that this contains the new setting in it

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@ycombinator ycombinator requested a review from a team as a code owner May 2, 2025 14:47
@ycombinator ycombinator requested review from blakerouse, kaanyalti and pchila and removed request for kaanyalti May 2, 2025 14:47
@ycombinator ycombinator added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label May 2, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Contributor

mergify bot commented May 2, 2025

This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label that automatically backports to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

blakerouse
blakerouse previously approved these changes May 2, 2025
Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Looks good. All unit tests and integration tests pass. Only failure is related to check-ci and then change to elastic-agent.reference.yml.

pchila
pchila previously approved these changes May 5, 2025
Copy link
Member

@pchila pchila left a comment

Choose a reason for hiding this comment

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

Left a couple of nitpicks about the new settings description, not blocking. Feel free to resolve them if you think those are unnecessary.
LGTM

@ycombinator ycombinator enabled auto-merge (squash) May 6, 2025 12:19
@ycombinator ycombinator requested a review from pchila May 6, 2025 12:19
pchila
pchila previously approved these changes May 6, 2025
@ycombinator ycombinator force-pushed the config-rollback-window branch from 40ffcbe to 98e3528 Compare May 6, 2025 21:07
Copy link

@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @ycombinator

@ycombinator ycombinator merged commit b5823bd into elastic:main May 7, 2025
12 checks passed
@ycombinator ycombinator deleted the config-rollback-window branch May 7, 2025 12:17
v1v added a commit to v1v/elastic-agent that referenced this pull request May 8, 2025
* upstream/main:
  Guard against `nil` pointer dereference (elastic#8107)
  Generate NOTICE.txt with only modules used by binaries (elastic#8053)
  Retry enrollment requests when an error is returned, add enrollment timeout (elastic#8056)
  Changelog for 8.17.6 version (elastic#8062) (elastic#8106)
  [main][Automation] Update versions (elastic#8098)
  Allow using beats receivers for self-monitoring (elastic#8031)
  Adding new configuration setting: `agent.upgrade.rollback.window` (elastic#8065)
  [Integration Testing] Allow tests to declare themselves as needing a FIPS environment (elastic#8083)
  fix(agentless): overcome SIGPIPE in agentless promotion pipeline (elastic#8094)
  ksm autosharing integration configuration update (elastic#8086)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip 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_window to elastic agent configuration with a default value of 7d
4 participants