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 2023/01/04 00:18:56 UTC

[GitHub] [ozone] errose28 commented on a diff in pull request #4138: HDDS-5934. Add OM NodeID to VERSION file.

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: issues-unsubscribe@ozone.apache.org

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