private List<IneligibleReplica> ineligibleReplicasForIsr(List<BrokerState> brokerStates) {
        List<IneligibleReplica> ineligibleReplicas = new ArrayList<>(0);
        for (BrokerState brokerState : brokerStates) {
            int brokerId = brokerState.brokerId();
            BrokerRegistration registration = clusterControl.registration(brokerId);
            if (registration == null) {
                ineligibleReplicas.add(new IneligibleReplica(brokerId, "not registered"));
            } else if (registration.inControlledShutdown()) {
                ineligibleReplicas.add(new IneligibleReplica(brokerId, "shutting down"));
            } else if (registration.fenced()) {
                ineligibleReplicas.add(new IneligibleReplica(brokerId, "fenced"));
            } else if (brokerState.brokerEpoch() != -1 && registration.epoch() != brokerState.brokerEpoch()) {
                // The given broker epoch should match with the broker epoch in the broker registration, except the
                // given broker epoch is -1 which means skipping the broker epoch verification.
                ineligibleReplicas.add(new IneligibleReplica(brokerId,
                    "broker epoch mismatch: requested=" + brokerState.brokerEpoch()
                        + " VS expected=" + registration.epoch()));
            }
        }
        return ineligibleReplicas;
    }
Validate the partition information included in the alter partition request.

@param brokerId id of the broker requesting the alter partition
@param topic current topic information store by the replication manager
@param partitionId partition id being altered
@param partition current partition registration for the partition being altered
@param partitionData partition data from the alter partition request

@return Errors.NONE for valid alter partition data; otherwise the validation error
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java