private synchronized void updateActiveMembers(Collection<Member> allKnownMembers) {
        List<Member> knownMembers = new ArrayList<>(allKnownMembers);
        knownMembers.sort(MEMBER_PRIORITY_COMPARATOR);
        int size = knownMembers.size();
        List<Member> tempActiveSortedAiServingMembers = new ArrayList<>(size);
        List<Member> tempActiveSortedGatewayMembers = new ArrayList<>(size);
        List<Member> tempActiveSortedServiceMembers = new ArrayList<>(size);
        for (Member member : knownMembers) {
            if (member.getStatus()
                    .isActive()) {
                switch (member.getNodeType()) {
                    case AI_SERVING -> tempActiveSortedAiServingMembers.add(member);
                    case GATEWAY -> tempActiveSortedGatewayMembers.add(member);
                    case SERVICE -> tempActiveSortedServiceMembers.add(member);
                }
            }
        }
        activeSortedAiServingMembers = tempActiveSortedAiServingMembers;
        activeSortedGatewayMembers = tempActiveSortedGatewayMembers;
        activeSortedServiceMembers = tempActiveSortedServiceMembers;
    }
@param newMember can be the local node
turms-server-common/src/main/java/im/turms/server/common/infra/cluster/service/discovery/DiscoveryService.java