What application is used to generate the state machine demo in the docs? #396
|
Is the source code for the application/test used for the state machine demo available? I'm curious how the invariant that there should be at most one Leader at a time is communicated to the test. |
Answered by
lovettchris
Jul 7, 2020
Replies: 2 comments
|
Yes, the sample code is available here. The code has evolved a bit since the diagram was generated, but you can see the SafetyMonitor is the one that is ensuring there is only one leader per "Term", where Term is a concept of version or time in the Raft protocol. This is for the "Mock" version where testing of the Raft protocol is done all in one process. |
0 replies
Answer selected by
pdeligia
|
Got it, thanks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, the sample code is available here. The code has evolved a bit since the diagram was generated, but you can see the SafetyMonitor is the one that is ensuring there is only one leader per "Term", where Term is a concept of version or time in the Raft protocol. This is for the "Mock" version where testing of the Raft protocol is done all in one process.