private static void maybeRemoveControllerNode(List<NodeRuntimeMetadata> allNodes, List<FailedWal> failedWALList) {
        long inactiveControllerCount = allNodes.stream()
            .filter(NodeRuntimeMetadata::isController)
            .filter(node -> !node.isActive())
            .count();
        if (inactiveControllerCount > 1) {
            LOGGER.warn("{} controller nodes is inactive, will not failover any controller node", inactiveControllerCount);
            Set<Integer> controllerNodeIds = allNodes.stream()
                .filter(NodeRuntimeMetadata::isController)
                .map(NodeRuntimeMetadata::id)
                .collect(Collectors.toSet());
            failedWALList.removeIf(wal -> controllerNodeIds.contains(wal.nodeId()));
        }
    }
Reset the failover context whose target node is not alive
core/src/main/java/kafka/automq/failover/FailoverControlManager.java