3 ms·
> That is what I was thinking. But does that mean you just pepper your command processing logic with guards that you are still actually the leader? Yep. It's a
by jimsimmons 5y ago
> That is what I was thinking. But does that mean you just pepper your command processing logic with guards that you are still actually the leader?
Yep. It's annoying to code it this way but you have to. One way to make this relatively clean is via throwing and catching exceptions if your language has good support for it.
Also agree re single-threadedness. In some ways raft assumes a single state machine loop running on a node at any point. Concurrency introduces additional non determinism to the state machine and isn't really accounted for in the formal spec.
I've heard great things about etcd source and how clean it is. I've never studied it but it might give you some pointers on best practices.