private int findNewWorkerId() {
        Integer localWorkerId = discoveryService.getLocalServiceMemberIndex();
        if (localWorkerId == null) {
            // Use the previous worker ID instead of 0
            // to decrease the chance of collision.
            return previousLocalWorkerId;
        }
        if (localWorkerId >= SnowflakeIdGenerator.MAX_WORKER_ID) {
            int fallbackWorkerId = localWorkerId % SnowflakeIdGenerator.MAX_WORKER_ID;
            LOGGER.warn("The node ID ({}) is larger than {}, so the ID falls back to ({})."
                    + " It runs the risk of generating same IDs in the cluster",
                    localWorkerId,
                    SnowflakeIdGenerator.MAX_WORKER_ID - 1,
                    fallbackWorkerId);
            return fallbackWorkerId;
        }
        return localWorkerId;
    }
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