Skip to content

fix storage #32

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

Merged
merged 1 commit into from
Aug 15, 2024
Merged

fix storage #32

merged 1 commit into from
Aug 15, 2024

Conversation

dierbei
Copy link
Collaborator

@dierbei dierbei commented Aug 15, 2024

After several tests, now persistent LogEntry to disk truncates the file, and the data can't be recovered after reboot.

Hopefully some improvements can be made, please help me with the review, thanks!

raft-rs/src/storage.rs

Lines 60 to 63 in 85ec6c2

let mut file = File::create(&self.path).await.map_err(Error::Io)?;
file.write_all(&data_with_checksum)
.await
.map_err(Error::Io)?;

Signed-off-by: dierbei <[email protected]>
Copy link
Contributor

@vaibhawvipul vaibhawvipul left a comment

Choose a reason for hiding this comment

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

LGTM. I was working on it myself. Great work! Thank you! ❤️

@vaibhawvipul vaibhawvipul merged commit 8f08240 into spacewalkhq:main Aug 15, 2024
1 check passed
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.

2 participants