private int findNewDataCenterId() {
        TreeSet<String> zones = new TreeSet<>();
        for (Member member : discoveryService.getAllKnownMembers()
                .values()) {
            zones.add(member.getZone());
        }
        int dataCenterId = zones.headSet(discoveryService.getLocalMember()
                .getZone())
                .size();
        if (dataCenterId >= SnowflakeIdGenerator.MAX_DATA_CENTER_ID) {
            int fallbackDataCenterId = dataCenterId % SnowflakeIdGenerator.MAX_DATA_CENTER_ID;
            LOGGER.warn("The data center ID ({}) is larger than {}, so the ID falls back to ({})."
                    + " It runs the risk of generating same IDs in the cluster",
                    dataCenterId,
                    SnowflakeIdGenerator.MAX_DATA_CENTER_ID - 1,
                    fallbackDataCenterId);
            dataCenterId = fallbackDataCenterId;
        }
        return dataCenterId;
    }
Note: It is unnecessary to check if the ID is 0L because it should never happen due to its
implementation
turms-server-common/src/main/java/im/turms/server/common/infra/cluster/service/idgen/IdService.java