public synchronized boolean hasAllFetchPositions() {
        // Since this is in the hot-path for fetching, we do this instead of using java.util.stream API
        Iterator<TopicPartitionState> it = assignment.stateIterator();
        while (it.hasNext()) {
            if (!it.next().hasValidPosition()) {
                return false;
            }
        }
        return true;
    }
Unset the preferred read replica. This causes the fetcher to go back to the leader for fetches.

@param tp The topic partition
@return the removed preferred read replica if set, Empty otherwise.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java