@Override
    public void start() {
        listenLeaderChangeEvent();

        // Members
        listenMembersChangeEvent();
        List<Member> memberList;
        try {
            memberList = queryMembers().collect(CollectorUtil.toList())
                    .block(CRUD_TIMEOUT_DURATION);
        } catch (Exception e) {
            throw new RuntimeException("Failed to find members", e);
        }
        Member localMember = localNodeStatusManager.getLocalMember();
        boolean isSameId;
        boolean isSameAddress;
        for (Member member : memberList) {
            isSameId = localMember.isSameId(member);
            isSameAddress = localMember.isSameAddress(member);
            if (isSameId || isSameAddress) {
                if (!isAvailableMember(member, System.currentTimeMillis())) {
                    Mono<Boolean> removedMemberIfInavailable = isSameId
                            ? removeMemberIfInavailable(member.getNodeId(), null, null)
                            : removeMemberIfInavailable(member.getNodeId(),
                                    member.getMemberHost(),
                                    member.getMemberPort());
                    boolean isConflictedNodeRemoved =
                            removedMemberIfInavailable.block(CRUD_TIMEOUT_DURATION);
                    if (isConflictedNodeRemoved) {
                        continue;
                    }
                }
                String message =
                        "Failed to bootstrap the local node because the local node has been registered. "
                                + "Local Node: "
                                + localMember
                                + ". "
                                + "Registered Node: "
                                + member;
                throw new RuntimeException(message);
            }
            onMemberAddedOrReplaced(member);
        }
        onMemberAddedOrReplaced(localMember);
        updateActiveMembers(allKnownMembers.values());

        try {
            localNodeStatusManager.registerLocalNodeAsMember(false)
                    .block(CRUD_TIMEOUT_DURATION);
        } catch (Exception e) {
            throw new RuntimeException(
                    "Caught an error while registering the local node as a member",
                    e);
        }
        boolean isLeader;
        try {
            isLeader = localNodeStatusManager.tryBecomeFirstLeader()
                    .block();
        } catch (Exception e) {
            throw new RuntimeException(
                    "Caught an error while trying to become the first leader",
                    e);
        }
        if (isLeader) {
            LOGGER.info("The local node has become the first leader");
        }
        localNodeStatusManager.startHeartbeat();
    }
@return a positive or negative number, and never 0 to ensure that the order is consistent in
        every node.
turms-server-common/src/main/java/im/turms/server/common/infra/cluster/service/discovery/DiscoveryService.java