The active controller creates an in-memory snapshot for every offset returned by RaftClient::scheduleAppend and RaftClient::scheduleAtomicAppend. For RaftClient::scheduleAppend, the RaftClient is free to split those records into multiple batches. Because of this when scheduleAppend is use there is no guarantee that the active leader will always have an in-memory snapshot for every "last committed offset".
To get around this problem, when the active controller renounces from leader if there is no snapshot at the last committed offset it will instead.
- Reset the snapshot registry
- Unregister the listener from the RaftClient
- Register a new listener with the RaftClient