Skip to content
Snippets Groups Projects
Commit b77ff1da authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

important: arrange transaction scope in NodeImpl

Raft-rs interface requires the application to process special structure,
the so-called "ready state". It also makes a demand on the processing
workflow. The fields must be processed in a certain sequence, see
<https://docs.rs/raft/0.6.0/raft/index.html#processing-the-ready-state>.

For example, it was a mistake to send `persisted_messages` inside a
transaction, because it's forbidded to do so before persisting the hard
state, but the actual write happens only in the end of transaction.

As for handling `soft_state` and `read_states`, they're useless in a
transaction as they don't persist anything.

The documentation is quite complicated, so this code might be revised
once again later.
parent 9450b27f
No related branches found
No related tags found
1 merge request!260important: arrange transaction scope in NodeImpl
Pipeline #12232 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment