sokui commented on code in PR #3185:
URL: https://github.com/apache/ozone/pull/3185#discussion_r867381628


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHANodeDetails.java:
##########
@@ -227,13 +230,22 @@ public static SCMHANodeDetails 
loadSCMHAConfig(OzoneConfiguration conf)
           throw e;
         }
 
-        if (addr.isUnresolved()) {
+        boolean flexibleFqdnResolutionEnabled = conf.getBoolean(
+                OZONE_FLEXIBLE_FQDN_RESOLUTION_ENABLED,
+                OZONE_FLEXIBLE_FQDN_RESOLUTION_ENABLED_DEFAULT);
+        if (!flexibleFqdnResolutionEnabled && addr.isUnresolved()
+                || flexibleFqdnResolutionEnabled
+                && !isAddressHostNameLocal(addr)) {

Review Comment:
   updated



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHANodeDetails.java:
##########
@@ -227,13 +230,22 @@ public static SCMHANodeDetails 
loadSCMHAConfig(OzoneConfiguration conf)
           throw e;
         }
 
-        if (addr.isUnresolved()) {
+        boolean flexibleFqdnResolutionEnabled = conf.getBoolean(
+                OZONE_FLEXIBLE_FQDN_RESOLUTION_ENABLED,
+                OZONE_FLEXIBLE_FQDN_RESOLUTION_ENABLED_DEFAULT);
+        if (!flexibleFqdnResolutionEnabled && addr.isUnresolved()
+                || flexibleFqdnResolutionEnabled
+                && !isAddressHostNameLocal(addr)) {
           LOG.error("Address for SCM {} : {} couldn't be resolved. Proceeding "
                   + "with unresolved host to create Ratis ring.", nodeId,
               rpcAddrStr);
         }
 
-        if (!addr.isUnresolved() && !isPeer && ConfUtils.isAddressLocal(addr)) 
{
+        if (!isPeer && (!flexibleFqdnResolutionEnabled
+                && !addr.isUnresolved()
+                && ConfUtils.isAddressLocal(addr)
+                || flexibleFqdnResolutionEnabled
+                && isAddressHostNameLocal(addr))) {

Review Comment:
   updated



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