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. |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
-
Got it, thanks! |
Beta Was this translation helpful? Give feedback.
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.