bharatviswa504 commented on a change in pull request #1494:
URL: https://github.com/apache/ozone/pull/1494#discussion_r642199349
##########
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();
+ LOG.info("Received Configuration change notification from Ratis. New Peer"
+
+ " list:\n{}", newPeers);
+ for (RaftProtos.RaftPeerProto raftPeerProto : newPeers) {
+ String omNodeId = RaftPeerId.valueOf(raftPeerProto.getId()).toString();
+ if (!ozoneManager.doesPeerExist(omNodeId)) {
+ LOG.info("Adding new OM {} to the Peer list.", omNodeId);
+ ozoneManager.addOMNodeToPeers(omNodeId);
Review comment:
We can revisit this if we want to support with out change in config.
--
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]