-
Notifications
You must be signed in to change notification settings - Fork 209
Introduce install TTL markers #10344
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
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
Linter errors are already addressed in #9643 |
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, I manually tested that:
- .installed keeps track of installed versions when I upgrade with correct TTL
- .installed keeps track of installed version when I manually rollback (removes old version)
It doesn't yet clean up entries in .installed - I did manually edit the ttl and restarted elastic-agent - but this I can see from the code that this is in #9643; @pchila keep me honest here
Correct. The handling for the expired installs is in the follow-up PR which allows for manual rollbacks while not in the grace period. |
ycombinator
left a comment
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.
Starting to review this PR now but one general comment: could you please add godoc comments for any exported types, capturing what they represent / their purpose? Thanks.
ycombinator
left a comment
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.
|
CI failures in build https://buildkite.com/elastic/elastic-agent/builds/28194 are due to |
cd18e71 to
c2223f2
Compare
|
@pchila and I met today and came to the following conclusions:
|
|
This pull request is now in conflicts. Could you fix it? 🙏 |
2b6cba6 to
07acdab
Compare
|
cmacknz
left a comment
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.
Thanks for simplifying, a couple of comments but direction overall LGTM
💚 Build Succeeded
History
cc @pchila |
* Add available rollbacks list under /data * make TTLMarkerRegistry.addOrReplace private * Add logger to ttl marker source * Add fatal upgrade error if ttl marker cannot be set and related cleanup
What does this PR do?
This PR introduces a registry of elastic-agent installs by maintaining a YAML structure in .installed installation marker.As soon as a new version of agent is unpacked on disk during an upgrade, the installation is added to the registry, updated when the symlinks are rotated to such installation and removed after the installation is deleted from disk.
At @cmacknz 's request the install registry has been scrapped substituted by a more limited but simpler mechanism.
This PR introduces TTL marker files in versioned homes of Elastic Agent versions to keep track of available manual rollback targets and the time until those installs should remain on disk.
When upgrading, existing installs are marked with a
.ttlYAML file, for example:This allows to determine which available rollbacks are still on disk even after the upgrade marker is removed at the end of a successful upgrade.
Why is it important?
This PR is a prerequisite for introducing manual rollbacks beyond grace period with PR #9643
Checklist
./changelog/fragmentsusing the changelog toolDisruptive User Impact
How to test this PR locally
Related issues
Questions to ask yourself