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/04/23 21:11:38 UTC

[GitHub] [helix] narendly opened a new pull request #968: Improve logging for isClusterSetup

narendly opened a new pull request #968:
URL: https://github.com/apache/helix/pull/968


   ### Issues
   
   - [x] My PR addresses the following Helix issues and references them in the PR description:
   
   Fixes #967 
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   
   This improves logging.
   ### Tests
   
   N/A
   
   ### 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"
   
   ### Documentation (Optional)
   
   - [ ] In case of new functionality, my PR adds documentation in the following wiki page:
   
   (Link the GitHub wiki you added)
   
   ### 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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414188369



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       @narendly One thing I need to correct. It does not have to be cluster in ill-form. If there is some network or ZK server issue, partial of the path has been read. You will get this error frequently. But it does not means the cluster is not well setup.
   
   For your change, I am fine. But I think we should think about to reduce the places of using isClusterSetup.




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414899153



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       There was an issue for the HelixAdmin get resource. The cluster just added 1 min ago. And we verify the cluster does create successfully. Using another HelixAdmin to create a resource make it failed. It is network issue.
   
   It will not be related to the log warning or debug, but we need to think about the whether we should apply this isClusterSetup check anywhere. And as I said, I am OK with the log itself.




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414164085



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       1. Generally the pipeline shouldn't call this every time.
   2. If this condition is met, that means the cluster is not in the right state anyways, so it's good that we make this a warn log to be able to diagnose the problem appropriately. Clusters that aren't ill-formed won't get this log.




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414180793



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       It is better to ask original author to see whether it is a concern or not. @lei-xia 




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



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


[GitHub] [helix] dasahcc commented on pull request #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
dasahcc commented on pull request #968:
URL: https://github.com/apache/helix/pull/968#issuecomment-618720114


   I checked all the callers. Anyway they will make an exception along with that. So it should be fine to enable warn log back. 
   
   Let's whether there is any other concerns from @lei-xia . If not, I am gonna approve 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



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


[GitHub] [helix] narendly commented on pull request #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
narendly commented on pull request #968:
URL: https://github.com/apache/helix/pull/968#issuecomment-619267725


   This PR is ready to be merged, approved by @alirezazamani 


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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414750854



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       Additionally, what you said doesn't really strengthen your case about logging because connectivity issues are supposed to be transient. Then how does that make logging worse? If anything, this would serve as an important marker that lets you know that there were connectivity issues.




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414164085



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       1. Generally the pipeline shouldn't call this every time.
   2. If this condition is met, that means the cluster is not in the right state anyways, so it's good that we make this a warn log to be able to diagnose the problem appropriately. Clusters that aren't ill-formed won't get this log. In other words, you better get the cluster fixed before worrying if there are too many logs.




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414901472



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       What you're talking about is whether it's appropriate to call isClusterSetup. That's not the focus of this PR - please create a separate issue to track that work if you think is necessary.




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414749863



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       @dasahcc 
   We still need to record this in order to diagnose whether it was a connectivity issue that caused this. Otherwise, how do you prove that it was a connectivity issue?




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



---------------------------------------------------------------------
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 #968: Improve logging for isClusterSetup

Posted by GitBox <gi...@apache.org>.
dasahcc commented on a change in pull request #968:
URL: https://github.com/apache/helix/pull/968#discussion_r414154467



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
##########
@@ -112,13 +112,13 @@ public static boolean isClusterSetup(String clusterName, RealmAwareZkClient zkCl
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg.append("Invalid cluster setup, missing znode path: ").append(requiredPaths.get(i))
-            .append("\n");
+        errorMsg.append("Invalid cluster setup for cluster: ").append(clusterName)
+            .append(", missing znode path: ").append(requiredPaths.get(i)).append("\n");
       }
     }
 
     if (!isValid) {
-      logger.debug(errorMsg.toString());
+      logger.warn(errorMsg.toString());

Review comment:
       Will this generate a lot of logs? That is the reason we move this to debug log instead of warning or even info.




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



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