Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support retrieving current term (hashicorp#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).
- Loading branch information