raft/read_only.go
func (ro *readOnly) recvAck(m pb.Message) int {
	rs, ok := ro.pendingReadIndex[string(m.Context)]
	if !ok {
		return 0
	}

	rs.acks[m.From] = struct{}{}
	// add one to include an ack from local node
	return len(rs.acks) + 1
}
func (ro *readOnly) recvAck(m pb.Message) int {
	rs, ok := ro.pendingReadIndex[string(m.Context)]
	if !ok {
		return 0
	}

	rs.acks[m.From] = struct{}{}
	// add one to include an ack from local node
	return len(rs.acks) + 1
}
func ( ro * readOnly ) recvAck ( m pb . Message ) int { rs , ok := ro . pendingReadIndex [ string ( m . Context ) ] if ! ok { return 0 } rs . acks [ m . From ] = struct { } { } // add one to include an ack from local node return len ( rs . acks ) + 1 }
// recvAck notifies the readonly struct that the raft state machine received
// an acknowledgment of the heartbeat that attached with the read only request
// context.
recvAck notifies the readonly struct that the raft state machine received an acknowledgment of the heartbeat that attached with the read only request context .