You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/03/26 22:38:17 UTC

[GitHub] [helix] narendly opened a new pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

narendly opened a new pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915
 
 
   ### Issues
   
   - [x] My PR addresses the following Helix issues and references them in the PR description:
   
   Fixes #914 
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   
   It was observed that we need more fine-grained control over this multiZkEnabled config because there could exists namespaces with differing modes. Because multiple namespaces may be co-deployed, we cannot simply make it a system config.
   
   ### Tests
   
   - [x] The following tests are written for this issue:
   
   Covered by existing tests.
   
   - [x] The following is the result of the "mvn test" command on the appropriate module:
   
   [ERROR] Failures: 
   [ERROR]   TestResourceAccessor.testResourceHealth:289 expected:<HEALTHY> but was:<UNHEALTHY>
   [INFO] 
   [ERROR] Tests run: 144, Failures: 1, Errors: 0, Skipped: 7
   [INFO] 
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD FAILURE
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  38.519 s
   [INFO] Finished at: 2020-03-26T15:37:48-07:00
   [INFO] ------------------------------------------------------------------------
   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test) on project helix-rest: There are test failures.
   
   
   Known failure. This will be dealt with in a different PR.
   
   ### Commits
   
   - [x] My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   
   ### Code Quality
   
   - [x] My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398946547
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -111,20 +114,9 @@ public RealmAwareZkClient getRealmAwareZkClient() {
       synchronized (this) {
         if (_zkClient == null) {
           // If the multi ZK config is enabled, use FederatedZkClient on multi-realm mode
-          if (Boolean.parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
-            LOG.info("ServerContext: initializing FederatedZkClient with routing ZK at {}!",
-                _zkAddr);
+          if (_isMultiZkEnabled || Boolean
+              .parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
 
 Review comment:
   It is false if it's not set by default.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] NealSun96 commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
NealSun96 commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398946080
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -111,20 +114,9 @@ public RealmAwareZkClient getRealmAwareZkClient() {
       synchronized (this) {
         if (_zkClient == null) {
           // If the multi ZK config is enabled, use FederatedZkClient on multi-realm mode
-          if (Boolean.parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
-            LOG.info("ServerContext: initializing FederatedZkClient with routing ZK at {}!",
-                _zkAddr);
+          if (_isMultiZkEnabled || Boolean
+              .parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
 
 Review comment:
   Then the system config should have a default value = "false". When user wants to enable fine-grained control, they shouldn't be manually setting `MULTI_ZK_ENABLED = 'false'` and then setting the per-namespace values; that will only be confusing. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398942073
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -111,20 +114,9 @@ public RealmAwareZkClient getRealmAwareZkClient() {
       synchronized (this) {
         if (_zkClient == null) {
           // If the multi ZK config is enabled, use FederatedZkClient on multi-realm mode
-          if (Boolean.parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
-            LOG.info("ServerContext: initializing FederatedZkClient with routing ZK at {}!",
-                _zkAddr);
+          if (_isMultiZkEnabled || Boolean
+              .parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
 
 Review comment:
   > Aren't we moving away from system properties?
   Why?
   
   > If we allow both it could be confusing, unless we specifically document for it.
   This is for convenience. Users that have many namespaces can simply set the system property. Otherwise for more fine-grained control, they can set it at the namespace granularity.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] dasahcc commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398948212
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -136,7 +128,20 @@ public RealmAwareZkClient getRealmAwareZkClient() {
               // Refresh data subscription
               _zkClientForListener.unsubscribeAll();
               _zkClientForListener.subscribeRoutingDataChanges(this, this);
+              LOG.info("ServerContext: subscribed to routing data in routing ZK at {}!", _zkAddr);
 
 Review comment:
   Why we change the place? Could _zkClientForListener be null? It should be constructed when the ServerContext built.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on issue #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly commented on issue #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#issuecomment-604760168
 
 
   This PR is ready to be merged, approved by @NealSun96 
   
   It was observed that we need more fine-grained control over this multiZkEnabled config because there could exists namespaces with differing modes. Because multiple namespaces may be co-deployed, we cannot simply make it a system config.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398966690
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -136,7 +128,20 @@ public RealmAwareZkClient getRealmAwareZkClient() {
               // Refresh data subscription
               _zkClientForListener.unsubscribeAll();
               _zkClientForListener.subscribeRoutingDataChanges(this, this);
+              LOG.info("ServerContext: subscribed to routing data in routing ZK at {}!", _zkAddr);
 
 Review comment:
   I just changed the order so that control flow is not broken if FederatedZkClient creation throws an exception.
   
   You can imagine a scenario in which, in the previous order, if FederatedZkClient creation failed and threw an exception, this whole resubscription logic would be skipped altogether, which is not what we want.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] NealSun96 commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
NealSun96 commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398940552
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -111,20 +114,9 @@ public RealmAwareZkClient getRealmAwareZkClient() {
       synchronized (this) {
         if (_zkClient == null) {
           // If the multi ZK config is enabled, use FederatedZkClient on multi-realm mode
-          if (Boolean.parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
-            LOG.info("ServerContext: initializing FederatedZkClient with routing ZK at {}!",
-                _zkAddr);
+          if (_isMultiZkEnabled || Boolean
+              .parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) {
 
 Review comment:
   Aren't we moving away from system properties? 
   If we allow both it could be confusing, unless we specifically document for it. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398966690
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/server/ServerContext.java
 ##########
 @@ -136,7 +128,20 @@ public RealmAwareZkClient getRealmAwareZkClient() {
               // Refresh data subscription
               _zkClientForListener.unsubscribeAll();
               _zkClientForListener.subscribeRoutingDataChanges(this, this);
+              LOG.info("ServerContext: subscribed to routing data in routing ZK at {}!", _zkAddr);
 
 Review comment:
   I just changed the order so that control flow is not broken if FederatedZkClient creation throws an exception.
   
   You can imagine a scenario in which, in the previous order, if FederatedZkClient creation failed and threw an exception, this whole resubscription logic would be skipped altogether, which is not what we want.
   
   Also this listener zkclient should be lazily instantiated, not when ServerContext is built. The reason for it is that ServerContext may be constructed before ZK has started up.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly merged pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly merged pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] dasahcc commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398936853
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/common/HelixRestNamespace.java
 ##########
 @@ -35,6 +35,7 @@
     METADATA_STORE_TYPE,
     METADATA_STORE_ADDRESS,
     IS_DEFAULT,
+    MULTI_ZK_ENABLED,
 
 Review comment:
   Why we dont just rely on the system property but a new field?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #915: Make multiZkEnabled configurable in HelixRestNamespace
URL: https://github.com/apache/helix/pull/915#discussion_r398937194
 
 

 ##########
 File path: helix-rest/src/main/java/org/apache/helix/rest/common/HelixRestNamespace.java
 ##########
 @@ -35,6 +35,7 @@
     METADATA_STORE_TYPE,
     METADATA_STORE_ADDRESS,
     IS_DEFAULT,
+    MULTI_ZK_ENABLED,
 
 Review comment:
   This is what the description says - please refer to the description carefully and let me know if it answers your question.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org