Skip to content

Expose UpdateMarkerFile func with transactional lock #8449

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

michalpristas
Copy link
Contributor

Complementary function to work introduced in #8254

Allows read-modify-write withing single transational lock

@michalpristas michalpristas requested a review from pchila June 11, 2025 11:31
@michalpristas michalpristas self-assigned this Jun 11, 2025
@michalpristas michalpristas requested a review from a team as a code owner June 11, 2025 11:31
@michalpristas michalpristas added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Jun 11, 2025
@elasticmachine
Copy link
Collaborator

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

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.

I think we are missing a testcase.
This change is also opening the possibility for caller of (load|save)MarkerToPath to read/write the update marker in an unsafe way with the isSafe parameters.

@michalpristas michalpristas requested review from pchila June 12, 2025 07:28
@michalpristas
Copy link
Contributor Author

michalpristas commented Jun 12, 2025

@pchila i resolved everything because i redid how this is executed

Copy link
Contributor

mergify bot commented Jun 12, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/upgrade_marker upstream/feat/upgrade_marker
git merge upstream/main
git push upstream feat/upgrade_marker

Copy link

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @michalpristas

Copy link
Contributor

@pkoutsovasilis pkoutsovasilis left a comment

Choose a reason for hiding this comment

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

The code changes LGTM, @pchila please do have a look 🙂

@pchila
Copy link
Member

pchila commented Jun 19, 2025

I would put this on hold until we have a clearer idea if we want to maintain locking for the upgrade marker file.
Should we decide to change the solution to a lock-free implementation this should not be merged and #8254 should be reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip enhancement New feature or request skip-changelog 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.

4 participants