type ReadState … type readIndexStatus … type readOnly … func newReadOnly(option ReadOnlyOption) *readOnly { … } // addRequest adds a read only request into readonly struct. // `index` is the commit index of the raft state machine when it received // the read only request. // `m` is the original read only request message from the local or remote node. func (ro *readOnly) addRequest(index uint64, m pb.Message) { … } // recvAck notifies the readonly struct that the raft state machine received // an acknowledgment of the heartbeat that attached with the read only request // context. func (ro *readOnly) recvAck(id uint64, context []byte) map[uint64]bool { … } // advance advances the read only request queue kept by the readonly struct. // It dequeues the requests until it finds the read only request that has // the same context as the given `m`. func (ro *readOnly) advance(m pb.Message) []*readIndexStatus { … } // lastPendingRequestCtx returns the context of the last pending read only // request in readonly struct. func (ro *readOnly) lastPendingRequestCtx() string { … }