adoroszlai commented on code in PR #8235:
URL: https://github.com/apache/ozone/pull/8235#discussion_r2030197607


##########
hadoop-ozone/mini-cluster/src/main/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java:
##########
@@ -774,6 +774,9 @@ protected void configureSCM() {
           "3s");
       conf.setInt(ScmConfigKeys.OZONE_SCM_RATIS_PORT_KEY, getFreePort());
       conf.setInt(ScmConfigKeys.OZONE_SCM_GRPC_PORT_KEY, getFreePort());
+      if 
(conf.get(ScmConfigKeys.OZONE_SCM_HA_RATIS_SERVER_RPC_FIRST_ELECTION_TIMEOUT) 
== null) {
+        
conf.set(ScmConfigKeys.OZONE_SCM_HA_RATIS_SERVER_RPC_FIRST_ELECTION_TIMEOUT, 
"1s");
+      }

Review Comment:
   Yes, `Configuration.setIfUnset` does exactly that:
   
   
https://github.com/apache/hadoop/blob/626b227094027ed08883af97a0734d2db7863864/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L1494-L1503
   
   On a related note, it seems that any config with default value in 
`ozone-default.xml` etc. is always "set", because Ozone adds these defaults as 
normal configs:
   
   
https://github.com/apache/ozone/blob/1bee369bb231710c00478d0a58b4f88228606fac/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/OzoneConfiguration.java#L120-L133
   
   not as defaults:
   
   
https://github.com/apache/ozone/blob/1bee369bb231710c00478d0a58b4f88228606fac/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/OzoneConfiguration.java#L244
   
   (This behavior blocks HDDS-12688.)



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