Skip to content

Why does the RocksDB example flush wal in apply_sm() vs append_entries() #616

Answered by drmingdrmer
avantgardnerio asked this question in Q&A
Discussion options

You must be logged in to vote

This issue and the closing PR #619 should have answered part of your question:

PS: I assume upon startup the first method called is last_applied_state() to see if the node is pristine or not?

Right.
The first step is to build a RaftState with the return value from last_applied_state() and other method:
https://github.com/datafuselabs/openraft/blob/cb2985ad6af8b0097e1842d4025f9532e1664fbd/openraft/src/raft_state.rs#L15

and if that state has an old raft log index as last_applied then the node will get all the intervening logs from it's peers and try to re-apply them?

Whether to apply these log has to be left to openraft to decide: If a leader has committed these log, the leader w…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by avantgardnerio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants