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

[Upgrade Details] For critical state transitions, fsync upgrade marker file #3836

Merged
merged 4 commits into from
Dec 4, 2023

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Nov 28, 2023

What does this PR do?

This PR calls https://pkg.go.dev/os#File.Sync on the Upgrade Marker file when critical upgrade transitions happen.

Why is it important?

In case the Agent immediately crashes (e.g. host loses power) after critical upgrade transitions, these transitions will be persisted to disk in the Upgrade Marker file.

Checklist

  • 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

Related issues

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

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

@ycombinator ycombinator force-pushed the upgrade-marker-fsync branch 3 times, most recently from ca790da to 1c2c345 Compare December 1, 2023 13:59
@ycombinator ycombinator enabled auto-merge (squash) December 4, 2023 15:57
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@ycombinator ycombinator merged commit d31ed5b into elastic:main Dec 4, 2023
@ycombinator ycombinator deleted the upgrade-marker-fsync branch December 4, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants