gavinchou commented on code in PR #38388: URL: https://github.com/apache/doris/pull/38388#discussion_r1738357822
########## cloud/src/resource-manager/resource_manager.cpp: ########## @@ -157,28 +157,41 @@ bool ResourceManager::check_cluster_params_valid(const ClusterPB& cluster, std:: std::stringstream ss; bool no_err = true; int master_num = 0; + int follower_num = 0; for (auto& n : cluster.nodes()) { if (ClusterPB::SQL == cluster.type() && n.has_edit_log_port() && n.edit_log_port() && n.has_node_type() && (n.node_type() == NodeInfoPB_NodeType_FE_MASTER || - n.node_type() == NodeInfoPB_NodeType_FE_OBSERVER)) { + n.node_type() == NodeInfoPB_NodeType_FE_OBSERVER || + n.node_type() == NodeInfoPB_NodeType_FE_FOLLOWER)) { master_num += n.node_type() == NodeInfoPB_NodeType_FE_MASTER ? 1 : 0; + follower_num += n.node_type() == NodeInfoPB_NodeType_FE_FOLLOWER ? 1 : 0; continue; - } - if (ClusterPB::COMPUTE == cluster.type() && n.has_heartbeat_port() && n.heartbeat_port()) { + } else if (ClusterPB::COMPUTE == cluster.type() && n.has_heartbeat_port() && + n.heartbeat_port()) { continue; } ss << "check cluster params failed, node : " << proto_to_json(n); *err = ss.str(); no_err = false; break; } - // ATTN: add_cluster check must have only a master node - // add_node doesn't check it - if (check_master_num && ClusterPB::SQL == cluster.type() && master_num != 1) { + + if (check_master_num && ClusterPB::SQL == cluster.type()) { no_err = false; - ss << "cluster is SQL type, must have only one master node, now master count: " - << master_num; + if (master_num && follower_num) { Review Comment: if (num_master > 0 && num_follower > 0) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org