xyuanlu commented on a change in pull request #1129:
URL: https://github.com/apache/helix/pull/1129#discussion_r458424764



##########
File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java
##########
@@ -187,26 +187,31 @@ private void joinCluster() {
       LOG.info("auto registration is false for cluster" + _clusterName);
     }
 
+    InstanceConfig instanceConfig;
     if (!ZKUtil.isInstanceSetup(_zkclient, _clusterName, _instanceName, 
_instanceType)) {
       if (!autoJoin) {
         throw new HelixException("Initial cluster structure is not set up for 
instance: "
             + _instanceName + ", instanceType: " + _instanceType);
+      }
+      if (!autoRegistration) {
+        LOG.info(_instanceName + " is auto-joining cluster: " + _clusterName);
+        instanceConfig = HelixUtil.composeInstanceConfig(_instanceName);
       } else {
-        if (!autoRegistration) {
-          LOG.info(_instanceName + " is auto-joining cluster: " + 
_clusterName);
-          _helixAdmin.addInstance(_clusterName, 
HelixUtil.composeInstanceConfig(_instanceName));
-        } else {
-          LOG.info(_instanceName + " is auto-registering cluster: " + 
_clusterName);
-          CloudInstanceInformation cloudInstanceInformation = 
getCloudInstanceInformation();
-          String domain = cloudInstanceInformation
-              
.get(CloudInstanceInformation.CloudInstanceField.FAULT_DOMAIN.name()) + 
_instanceName;
-
-          InstanceConfig instanceConfig = 
HelixUtil.composeInstanceConfig(_instanceName);
-          instanceConfig.setDomain(domain);
-          _helixAdmin.addInstance(_clusterName, instanceConfig);
-        }
+        LOG.info(_instanceName + " is auto-registering cluster: " + 
_clusterName);
+        CloudInstanceInformation cloudInstanceInformation = 
getCloudInstanceInformation();
+        String domain = cloudInstanceInformation
+            
.get(CloudInstanceInformation.CloudInstanceField.FAULT_DOMAIN.name()) + 
_instanceName;
+        instanceConfig = HelixUtil.composeInstanceConfig(_instanceName);
+        instanceConfig.setDomain(domain);
       }
+      _helixAdmin.addInstance(_clusterName, instanceConfig);
+    } else {
+      ConfigAccessor.validateTopologySettingInInstanceConfig(
+          _configAccessor.getClusterConfig(_clusterName), _instanceName,
+          _configAccessor.getInstanceConfig(_clusterName,_instanceName));

Review comment:
       The InstanceConfig is autogenerated for that branch before line 207. Do 
we also need to check that as well? 




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

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