Commit 2b0032e
authored
Support retrieving current term (#620)
Simple addition to make this internal variable accessible (without relying on `stats` object, which is a brittle approach).
_Term_ is a fundamental concept in Raft consensus, so making it easily available to clients of this library seems like an obvious thing to do. There are also specific use cases supported by knowing the Term:
- Allow clients of this library to retrieve and display diagnostic information about the state of the Raft system.
- Support certain types of reads of a Raft-managed store. For example, if a client can check before and after a Read that an election has not taken place during the read, it allows those clients to make certain guarantees about the data read from the Raft-managed Store. One way to do this is to simply check that the Term has not changed (see [this discussion](https://groups.google.com/g/raft-dev/c/4QlyV0aptEQ/m/1JxcmSgRAwAJ) for more details).1 parent dd1f3da commit 2b0032e
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
1211 | 1216 | | |
1212 | 1217 | | |
1213 | 1218 | | |
| |||
0 commit comments