@Override
    public void onControllerChange(LeaderAndEpoch newLeaderAndEpoch) {
        curLeaderAndEpoch = newLeaderAndEpoch;
        eventQueue.append(new KRaftLeaderEvent(newLeaderAndEpoch));
    }
Check that the migration driver is in the correct state for a given event. If the event causes
updates (i.e., to ZK or broker RPCs), also check that the event is for the current KRaft controller epoch.
metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java