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

Add read to file:open/2 options in ra_lib:sync_file/1 #452

Merged
merged 2 commits into from
Jul 2, 2024

Commits on Jul 2, 2024

  1. ra_lib:sync_file/1: Add 'read' to 'file:open/2' options

    From the [file:open/2] docs:
    
    > `write` - The file is opened for writing. It is created if it does not
    > exist. If the file exists and `write` is not combined with `read`, the
    > file is truncated.
    
    Without this change, checkpoints which are promoted to snapshots end up
    as empty snapshot files.
    
    [file:open/2]: https://www.erlang.org/doc/apps/kernel/file.html#open/2
    
    Co-authored-by: Karl Nilsson <[email protected]>
    the-mikedavis and kjnilsson committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    4039d7d View commit details
    Browse the repository at this point in the history
  2. Add another server restart to coordination_SUITE:recover_from_checkpoint

    This ensures that we can recover from a snapshot which was promoted from
    a checkpoint. The restart earlier in the test case ensures that we can
    recover from a checkpoint but that doesn't provide an insights about
    checkpoint promotion.
    
    Without the fix for `ra_lib:sync_file/1` in the parent commit, this case
    fails on the new calls to `ra:restart_server/2`.
    the-mikedavis committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    f6c61e4 View commit details
    Browse the repository at this point in the history