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

fsync instead of calling Write #276

Open
Crypt-iQ opened this issue May 5, 2023 · 2 comments · May be fixed by #296
Open

fsync instead of calling Write #276

Crypt-iQ opened this issue May 5, 2023 · 2 comments · May be fixed by #296

Comments

@Crypt-iQ
Copy link
Contributor

Crypt-iQ commented May 5, 2023

Write doesn't sync to disk so a crash can corrupt data. One example of this is here:

func (h *headerStore) appendRaw(header []byte) error {
if _, err := h.file.Write(header); err != nil {
return err
}
return nil
}

I forget if there are other call-sites

@Chinwendu20
Copy link
Contributor

Nice. We would just add, file.Sync() for the appendRaw method in headerStore, CFheader store, filterdb store.

@mohamedawnallah
Copy link

Hey @Crypt-iQ I've submitted a PR for this issue. I'd love to receive any feedback! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants