morningman commented on code in PR #55308:
URL: https://github.com/apache/doris/pull/55308#discussion_r2301738708
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java:
##########
@@ -3185,19 +3186,32 @@ public void addFrontend(FrontendNodeType role, String
host, int editLogPort, Str
bdbha.addUnReadyElectableNode(nodeName, targetFollowerCount);
}
- // Only add frontend after removing the conflict nodes, to ensure
the exception safety.
- fe = new Frontend(role, nodeName, host, editLogPort);
- fe.setCloudUniqueId(cloudUniqueId);
- frontends.put(nodeName, fe);
+ if (!isFeCatalogReady(host, editLogPort)) {
+ // Only add frontend after removing the conflict nodes, to
ensure the exception safety.
+ fe = new Frontend(role, nodeName, host, editLogPort);
+ fe.setCloudUniqueId(cloudUniqueId);
+ frontends.put(nodeName, fe);
- LOG.info("add frontend: {}", fe);
+ LOG.info("add frontend: {}", fe);
- editLog.logAddFrontend(fe);
+ editLog.logAddFrontend(fe);
+ } else {
+ bdbha.removeUnReadyElectableNode(nodeName, getFollowerCount());
+ throw new DdlException("the catalog of " + nodeName " is
ready, cannot be added, please check again");
Review Comment:
```suggestion
throw new DdlException("the catalog of " + nodeName + " is
ready, cannot be added, please check again");
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]