bharatviswa504 commented on a change in pull request #1494:
URL: https://github.com/apache/ozone/pull/1494#discussion_r670146384
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -1339,7 +1339,38 @@ public void bootstrap(OMNodeDetails newOMNode) throws
IOException {
}
/**
- * Add a new OM Node to the HA cluster. This call comes from OMRatisServer
+ * When OMStateMachine receives a configuration change update, it calls
+ * this function to update the peers list, if required.
+ */
+ public void updatePeerList(List<String> omNodeIds) {
+ List<String> ratisServerPeerIdsList = omRatisServer.getPeerIds();
+ for (String omNodeId : omNodeIds) {
+ if (getOMNodeId().equals(omNodeId)) {
Review comment:
newOMRatisServer
```
for (OMNodeDetails peerInfo : peerNodes) {
String peerNodeId = peerInfo.getNodeId();
RaftPeerId raftPeerId = RaftPeerId.valueOf(peerNodeId);
RaftPeer raftPeer;
if (peerInfo.isHostUnresolved()) {
raftPeer = RaftPeer.newBuilder()
.setId(raftPeerId)
.setAddress(peerInfo.getRatisHostPortStr())
.build();
} else {
InetSocketAddress peerRatisAddr = new InetSocketAddress(
peerInfo.getInetAddress(), peerInfo.getRatisPort());
raftPeer = RaftPeer.newBuilder()
.setId(raftPeerId)
.setAddress(peerRatisAddr)
.build();
}
// Add other OM nodes belonging to the same OM service to the Ratis
ring
raftPeers.add(raftPeer);
}
return new OzoneManagerRatisServer(ozoneConf, omProtocol, omServiceId,
localRaftPeerId, ratisAddr, raftPeers, secConfig, certClient);
```
Looks like previously we don't save raftPeers in OzoneManagerRatisServer.
But now with this PR, on old node all nodes peer+local will be in peer list.
```
if (!isBootstrapping) {
// On regular startup, add all OMs to Ratis ring
raftPeers.add(localRaftPeer);
```
Where as for bootstrap due to this skip, we don't add
```
if (getOMNodeId().equals(omNodeId)) {
continue;
}
```
Due to this on bootstrap node peerlist does not include local node
There is a difference in raftPeers list in bootstrap and old node.
--
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]