You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/09 17:37:27 UTC

[GitHub] [ozone] hanishakoneru commented on a change in pull request #1494: HDDS-4330. Bootstrap new OM node

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



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java
##########
@@ -166,6 +167,29 @@ public void notifyTermIndexUpdated(long currentTerm, long index) {
     computeAndUpdateLastAppliedIndex(index, currentTerm, null, false);
   }
 
+  /**
+   * Called to notify state machine about configuration changes.
+   * Configurations changes include addition of newly bootstrapped OM.
+   */
+  @Override
+  public void notifyConfigurationChanged(long term, long index,
+      RaftProtos.RaftConfigurationProto newRaftConfiguration) {
+    List<RaftProtos.RaftPeerProto> newPeers =
+        newRaftConfiguration.getPeersList();

Review comment:
       Correct. If the log entry is a configurationEntry or a metadataEntry, then RaftServerImpl calls notifyTermIndexUpdated on StateMachine. 

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServer.java
##########
@@ -671,6 +672,21 @@ public RaftServerStatus checkLeaderStatus() {
     return RaftServerStatus.NOT_LEADER;
   }
 
+  @VisibleForTesting
+  public List<String> getCurrentPeersFromRaftConf() {
+    try {
+      Collection<RaftPeer> currentPeers =
+          server.getDivision(raftGroupId).getRaftConf().getCurrentPeers();
+      List<String> currentPeerList = new ArrayList<>();
+      currentPeers.forEach(e -> currentPeerList.add(e.getId().toString()));
+      return currentPeerList;
+    } catch (IOException e) {
+      // In this case we return not a leader.
+      LOG.error("Failed to get RaftServer information. ", e);

Review comment:
       Done.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org