gavinchou commented on code in PR #38388:
URL: https://github.com/apache/doris/pull/38388#discussion_r1738359699


##########
gensrc/proto/cloud.proto:
##########
@@ -142,6 +142,7 @@ message NodeInfoPB {
         UNKNOWN = 0;
         FE_MASTER = 1;

Review Comment:
   add comment // lagacy logic for one-master-multi-observer mode



##########
cloud/src/resource-manager/resource_manager.cpp:
##########
@@ -618,6 +631,37 @@ std::pair<TxnErrorCode, std::string> 
ResourceManager::get_instance(std::shared_p
     return ec;
 }
 
+// check instance pb is valid
+bool instance_is_valid(const InstanceInfoPB& instance) {

Review Comment:
   is_instance_valid()



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudClusterChecker.java:
##########
@@ -371,22 +371,33 @@ private void getCloudObserverFes() {
             LOG.debug("get cloud cluster, clusterId={} nodes={}",
                     Config.cloud_sql_server_cluster_id, cpb.getNodesList());
         }
-        List<Frontend> currentFes = 
Env.getCurrentEnv().getFrontends(FrontendNodeType.OBSERVER);
+        List<Frontend> currentFollowers = 
Env.getCurrentEnv().getFrontends(FrontendNodeType.FOLLOWER);
+        List<Frontend> currentObservers = 
Env.getCurrentEnv().getFrontends(FrontendNodeType.OBSERVER);
+        currentFollowers.addAll(currentObservers);
+        List<Frontend> currentFes = new 
ArrayList<>(currentFollowers.stream().collect(Collectors.toMap(
+                fe -> fe.getHost() + ":" + fe.getEditLogPort(),
+                fe -> fe,
+                (existing, replacement) -> existing
+        )).values());
         List<Frontend> toAdd = new ArrayList<>();
         List<Frontend> toDel = new ArrayList<>();
         List<Cloud.NodeInfoPB> expectedFes = cpb.getNodesList();
         diffNodes(toAdd, toDel, () -> {
+            // memory
             Map<String, Frontend> currentMap = new HashMap<>();
             String selfNode = Env.getCurrentEnv().getSelfNode().getIdent();
             for (Frontend fe : currentFes) {
                 String endpoint = fe.getHost() + "_" + fe.getEditLogPort();
                 if (selfNode.equals(endpoint)) {
                     continue;
                 }
+                // add type to map key, for diff
+                endpoint = endpoint + "_" + fe.getRole();

Review Comment:
   do we allow different roles for an idnetical endpont?



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudClusterChecker.java:
##########
@@ -399,9 +410,15 @@ private void getCloudObserverFes() {
                 if (selfNode.equals(endpoint)) {
                     continue;
                 }
-                Frontend fe = new Frontend(FrontendNodeType.OBSERVER,
+                Cloud.NodeInfoPB.NodeType type = node.getNodeType();

Review Comment:
   warning if any MASTER is given



-- 
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

Reply via email to