hanishakoneru commented on a change in pull request #1494:
URL: https://github.com/apache/ozone/pull/1494#discussion_r670746826



##########
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:
       > There is a difference in raftPeers list in bootstrap and old node.
   
   Correct. On a bootstrapping node, we do not add the local node to raftPeer 
list. This is done later when a setConfiguration request is executed and it 
calls OMRatisServer#addRaftPeer().
   
   ```
     /**
      * Add given node to list of RaftPeers.
      */
     public void addRaftPeer(OMNodeDetails omNodeDetails) {
       InetSocketAddress newOMRatisAddr = new InetSocketAddress(
           omNodeDetails.getHostAddress(), omNodeDetails.getRatisPort());
   
       raftPeers.add(RaftPeer.newBuilder()
           .setId(RaftPeerId.valueOf(omNodeDetails.getNodeId()))
           .setAddress(newOMRatisAddr)
           .build());
   
       LOG.info("Added OM {} to Ratis Peers list.", omNodeDetails.getNodeId());
     }
   ```
   
   As for the old code, the local node was added to raftPeers there too 
(OzoneManagerRatisServer Line#348 in old 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.

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]

Reply via email to