xBis7 commented on code in PR #3948:
URL: https://github.com/apache/ozone/pull/3948#discussion_r1020288228


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java:
##########
@@ -123,10 +122,8 @@ public SecurityConfig(ConfigurationSource configuration) {
 
     // Please Note: To make it easy for our customers we will attempt to read
     // HDDS metadata dir and if that is not set, we will use Ozone directory.
-    // TODO: We might want to fix this later.
-    this.metadatDir = this.configuration.get(HDDS_METADATA_DIR_NAME,
-        configuration.get(OZONE_METADATA_DIRS,
-            configuration.get(HDDS_DATANODE_DIR_KEY)));
+    this.metadataDir = this.configuration.get(HDDS_METADATA_DIR_NAME,
+        configuration.get(OZONE_METADATA_DIRS));

Review Comment:
   There are already null checks for this in `SecurityConfig`. Check 
[getKeyLocation()](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java#L273-L277)
 and 
[getCertificateLocation()](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java#L286-L290).
 
   
   With the new change and without `ozone.metadata.dirs` specified, that's the 
output in the logs
   ```
   2022-11-11 14:45:16,642 [main] INFO ha.HASecurityUtils: Initializing secure 
StorageContainerManager.
   Metadata directory can't be null. Please check configs.
   2022-11-11 14:45:16,992 [shutdown-hook-0] INFO 
server.StorageContainerManagerStarter: SHUTDOWN_MSG: 
   /************************************************************
   SHUTDOWN_MSG: Shutting down StorageContainerManager at scm/172.22.0.10
   
   ```



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