GlenGeng commented on a change in pull request #1981:
URL: https://github.com/apache/ozone/pull/1981#discussion_r588063654
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAManagerImpl.java
##########
@@ -85,25 +94,27 @@ public SCMHAManagerImpl(final ConfigurationSource conf,
*/
@Override
public void start() throws IOException {
- ratisServer.start();
- if (ratisServer.getDivision().getGroup().getPeers().isEmpty()) {
- // this is a bootstrapped node
- // It will first try to add itself to existing ring
- boolean success = HAUtils.addSCM(OzoneConfiguration.of(conf),
- new AddSCMRequest.Builder().setClusterId(scm.getClusterId())
- .setScmId(scm.getScmId()).setRatisAddr(
- scm.getSCMHANodeDetails().getLocalNodeDetails()
- // TODO : Should we use IP instead of hostname??
- .getRatisHostPortStr()).build(), scm.getSCMNodeId());
- if (!success) {
- throw new IOException("Adding SCM to existing HA group failed");
+ if (ratisServer != null) {
Review comment:
avoid too deep indent and un-necessary change.
How about
```
if (ratisServer == null) {
return
}
// original code
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]