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

Replace checkpoint file atomically ECFLOW-1925 #51

Merged

Conversation

marcosbento
Copy link
Collaborator

These changes modify the strategy used to store a checkpoint file.

Previously the storage operation consisted of (a) moving the current checkpoint file to a backup, and then (b) storing the contents of the checkpoint file. If the server was terminated during (b), the result would be a corrupt checkpoint file.
The new strategy consists of (a) storing the contents of the checkpoint file in a temporary file; (b) moving the current checkpoint to backup; and, finally, (c) promoting the temporary checkpoint file to the current by simply renaming the file. In this case, even if the storage operation is interrupted, the current checkpoint file will never lack integrity.

Re ECFLOW-1925

Copy link
Member

@iainrussell iainrussell left a comment

Choose a reason for hiding this comment

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

This looks really good - I especially like the fact that you take into account a full file system!

These changes modify the strategy used to store a checkpoint file.

Previously the storage operation consisted of (a) moving the current
checkpoint file to a backup, and then (b) storing the contents of the
checkpoint file. If the server was terminated during (b), the result
would be a corrupt checkpoint file.
The new strategy consists of (a) storing the contents of the checkpoint
file in a temporary file; (b) moving the current checkpoint to backup;
and, finally, (c) promoting the temporary checkpoint file to the current
by simply renaming the file. In this case, even if the storage operation
is interrupted, the current checkpoint file will never lack integrity.

Re ECFLOW-1925
@marcosbento marcosbento force-pushed the feature/ECFLOW-1925_atomic_checkpoint_file_replacement branch from a16783b to 9e44c54 Compare November 14, 2023 08:01
@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (3fca261) 80.17% compared to head (9e44c54) 83.55%.

Files Patch % Lines
Server/src/CheckPtSaver.cpp 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #51      +/-   ##
===========================================
+ Coverage    80.17%   83.55%   +3.38%     
===========================================
  Files          575      541      -34     
  Lines        57916    52586    -5330     
===========================================
- Hits         46432    43938    -2494     
+ Misses       11484     8648    -2836     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marcosbento marcosbento merged commit e53d71b into develop Nov 14, 2023
48 checks passed
@marcosbento marcosbento deleted the feature/ECFLOW-1925_atomic_checkpoint_file_replacement branch November 14, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants