public Optional<String> reasonAllControllersZkMigrationNotReady(
        MetadataVersion metadataVersion,
        Map<Integer, ControllerRegistration> controllers
    ) {
        if (!metadataVersion.isMigrationSupported()) {
            return Optional.of("The metadata.version too low at " + metadataVersion);
        } else if (!metadataVersion.isControllerRegistrationSupported()) {
            return Optional.empty();
        }
        for (int quorumNodeId : quorumNodeIds) {
            ControllerRegistration registration = controllers.get(quorumNodeId);
            if (registration == null) {
                return Optional.of("No registration found for controller " + quorumNodeId);
            } else if (!registration.zkMigrationReady()) {
                return Optional.of("Controller " + quorumNodeId + " has not enabled " +
                        "zookeeper.metadata.migration.enable");
            }
        }
        return Optional.empty();
    }
A holder class of the local node's supported feature flags as well as the quorum node IDs.
metadata/src/main/java/org/apache/kafka/controller/QuorumFeatures.java