GlenGeng commented on a change in pull request #1683:
URL: https://github.com/apache/ozone/pull/1683#discussion_r543073822
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -69,41 +65,49 @@
throws IOException {
this.address = haConf.getRatisBindAddress();
- SCMHAGroupBuilder scmHAGroupBuilder = new SCMHAGroupBuilder(haConf, conf);
- this.raftPeerId = scmHAGroupBuilder.getPeerId();
- this.raftGroupId = scmHAGroupBuilder.getRaftGroupId();
- this.raftGroup = scmHAGroupBuilder.getRaftGroup();
+ SCMHAGroupBuilder haGrpBuilder = new SCMHAGroupBuilder(haConf, conf);
final RaftProperties serverProperties = RatisUtil
.newRaftProperties(haConf, conf);
- this.scmStateMachine = new SCMStateMachine();
- this.server = RaftServer.newBuilder()
- .setServerId(raftPeerId)
- .setGroup(raftGroup)
+
+ RaftServer server = RaftServer.newBuilder()
+ .setServerId(haGrpBuilder.getPeerId())
+ .setGroup(haGrpBuilder.getRaftGroup())
.setProperties(serverProperties)
- .setStateMachine(scmStateMachine)
+ .setStateMachine(new SCMStateMachine())
.build();
+
+ this.division = server.getDivision(haGrpBuilder.getRaftGroupId());
Review comment:
You won't get a null, instead, the call will throw a
`GroupMismatchException` in this situation.
----------------------------------------------------------------
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]