sofastack / sofa-jraft

A production-grade java implementation of RAFT consensus algorithm.
https://www.sofastack.tech/projects/sofa-jraft/
Apache License 2.0
3.56k stars 1.14k forks source link

Raft's own rocksdb instance during snapshot #1024

Closed asad-awadia closed 10 months ago

asad-awadia commented 1 year ago

Your question

During onSnapshotSave jraft guarantees that there are no more writes going to the state machine

but what about jraft's own rocksdb? Is that also stopped? Are new write requests being written into the log and not being sent to the statemachine? Or is raft's own rocksdb also locked fully?

Environment

killme2008 commented 10 months ago

It will be blocked until the snapshot finishes( returns from onSnasphotSave). So you must carefully implement the onSnasphotSave callback, capture the snapshot synchronously, and then save it into persistent storage asynchronously.