errose28 commented on code in PR #4138:
URL: https://github.com/apache/ozone/pull/4138#discussion_r1061050524


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java:
##########
@@ -486,4 +487,27 @@ private String getOMAddrKeyWithSuffix(String serviceId, 
String nodeId) {
     return ConfUtils.addKeySuffixes(OMConfigKeys.OZONE_OM_ADDRESS_KEY,
         serviceId, nodeId);
   }
+
+  /**
+   * Re-initializing OMStorage with new nodeId should fail.
+   */
+  @Test
+  public void testChangeOMNodeId() throws Exception {

Review Comment:
   Can we also test a restart and reinit scenario where the value is changed in 
the config to be different from the value in the VERSION file? This would more 
closely resemble the mistake a user would make that we are trying to catch.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -459,6 +459,7 @@ private OzoneManager(OzoneConfiguration conf, StartupOption 
startupOption)
     this.omNodeDetails = omhaNodeDetails.getLocalNodeDetails();
 
     omStorage = new OMStorage(conf);
+    omStorage.setOmNodeId(omNodeDetails.getNodeId(), true);

Review Comment:
   Do we need this line and the `persistToDisk` flag? The node ID should have 
been persisted during init, so the constructor can just load it. The other 
fields in `OMStorage` don't have an extra `persistToDisk` boolean parameter.



-- 
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