private ReplicaState ensureValidVoter(int remoteNodeId) {
        ReplicaState state = voterStates.get(remoteNodeId);
        if (state == null) {
            throw new IllegalArgumentException("Unexpected acknowledgement from non-voter " + remoteNodeId);
        }
        return state;
    }
Update the replica state in terms of fetch time and log end offsets.

@param replicaKey replica key
@param currentTimeMs current time in milliseconds
@param fetchOffsetMetadata new log offset and metadata
@return true if the high watermark is updated as a result of this call
raft/src/main/java/org/apache/kafka/raft/LeaderState.java