hanishakoneru commented on a change in pull request #1494:
URL: https://github.com/apache/ozone/pull/1494#discussion_r640909610
##########
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:
Yes, tried it out on a docker cluster and the config is reloaded from
disk.
> The only thing is when they add a new node, the users should change the
config on all nodes.
Yes that is a requirement to ensure that if the cluster is restarted, the
old nodes have information about the new 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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]