public void replay(FeatureLevelRecord record) {
        VersionRange range = quorumFeatures.localSupportedFeature(record.name());
        if (!range.contains(record.featureLevel())) {
            throw new RuntimeException("Tried to apply FeatureLevelRecord " + record + ", but this controller only " +
                "supports versions " + range);
        }
        if (record.name().equals(MetadataVersion.FEATURE_NAME)) {
            MetadataVersion mv = MetadataVersion.fromFeatureLevel(record.featureLevel());
            // AutoMQ inject start
            mv.setAutoMQVersion(autoMQVersion.get());
            // AutoMQ inject end
            metadataVersion.set(mv);
            log.info("Replayed a FeatureLevelRecord setting metadata.version to {}", mv);
        } else {
            if (record.featureLevel() == 0) {
                finalizedVersions.remove(record.name());
                log.info("Replayed a FeatureLevelRecord removing feature {}", record.name());
            } else {
                finalizedVersions.put(record.name(), record.featureLevel());
                log.info("Replayed a FeatureLevelRecord setting feature {} to {}",
                        record.name(), record.featureLevel());

            }
        }

        // AutoMQ inject start
        if (record.name().equals(AutoMQVersion.FEATURE_NAME)) {
            if (record.featureLevel() == 0) {
                autoMQVersion.set(AutoMQVersion.V0);
            } else {
                autoMQVersion.set(AutoMQVersion.from(record.featureLevel()));
            }
            MetadataVersion mv = metadataVersion.get();
            if (mv != null) {
                mv.setAutoMQVersion(autoMQVersion.get());
            }
        }
        // AutoMQ inject end

    }
Tests if the controller should be preventing metadata updates due to being in the PRE_MIGRATION
state. If the controller does not yet support migrations (before 3.4-IV0), then the migration state
will be NONE and this will return false. Once the controller has been upgraded to a version that supports
migrations, then this method checks if the migration state is equal to PRE_MIGRATION.
metadata/src/main/java/org/apache/kafka/controller/FeatureControlManager.java