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 support for explicit Sync #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevburnsjr
Copy link

@kevburnsjr kevburnsjr commented Mar 22, 2023

This PR adds one new public method buntdb.(*DB).Sync

WAL Compaction

I'd like to use BuntDB with SyncPolicy: Never as an on-disk state machine behind a Raft proposal log. The raft log acts as a WAL and the raft library calls Sync explicitly on the state machine during WAL compaction.

Without an explicit Sync operation in BuntDB, it's not possible to guarantee write durability. If the WAL is truncated and some updates have not yet been flushed to disk, a crash could cause unsynced writes to be discarded, causing the state machine to become unrecoverable.

Similar To

@mitar
Copy link

mitar commented Dec 31, 2023

Please add this.

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.

None yet

2 participants