void handleBrokerInControlledShutdown(int brokerId, long brokerEpoch, List<ApiMessageAndVersion> records) {
        if (featureControl.metadataVersion().isInControlledShutdownStateSupported()
                && !clusterControl.inControlledShutdown(brokerId)) {
            records.add(new ApiMessageAndVersion(new BrokerRegistrationChangeRecord().
                setBrokerId(brokerId).setBrokerEpoch(brokerEpoch).
                setInControlledShutdown(BrokerRegistrationInControlledShutdownChange.IN_CONTROLLED_SHUTDOWN.value()),
                (short) 1));
        }
        generateLeaderAndIsrUpdates("enterControlledShutdown[" + brokerId + "]",
            brokerId, NO_LEADER, NO_LEADER, records, brokersToIsrs.partitionsWithBrokerInIsr(brokerId), ElasticStreamSwitch.isEnabled());
    }
Generate the appropriate records to handle a broker starting a controlled shutdown.

First, we create an BrokerRegistrationChangeRecord. Then, we remove this broker
from any ISR and elect new leaders for partitions led by this
broker.

@param brokerId      The broker id.
@param brokerEpoch   The broker epoch.
@param records       The record list to append to.
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java