private void logAsymmetricPartition(final Map<Integer, Set<Integer>> topology) {
    final Set<Integer> nodes = topology.keySet();
    if (nodes.size() == 1) {
      // 1 DataNode
      return;
    }

    for (int from : nodes) {
      for (int to : nodes) {
        if (from >= to) {
          continue;
        }

        // whether we have asymmetric partition [from -> to]
        final Set<Integer> reachableFrom = topology.get(from);
        final Set<Integer> reachableTo = topology.get(to);
        if (reachableFrom.size() <= 1 || reachableTo.size() <= 1) {
          // symmetric partition for (from) or (to)
          continue;
        }
        if (!reachableTo.contains(from) && !reachableFrom.contains(to)) {
          LOGGER.warn("[Topology] Asymmetric network partition from {} to {}", from, to);
        }
      }
    }
  }
We only consider warning (one vs remaining) network partition. If we need to cover more
complicated scenarios like (many vs many) network partition, we shall use graph algorithms
then.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/TopologyService.java