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 2022/08/31 20:39:56 UTC
[GitHub] [helix] Marcosrico opened a new pull request, #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Marcosrico opened a new pull request, #2201:
URL: https://github.com/apache/helix/pull/2201
Downgraded error logs from `ZkClient` delete and `ZkBaseDataAcessor` remove methods to reduce logging noise for trivial errors.
### Issues
- [X] My PR addresses the following Helix issues and references them in the PR description:
https://jira01.corp.linkedin.com:8443/browse/HELIX-4375
(#200 - Link your issue number here: You can write "Fixes #XXX". Please use the proper keyword so that the issue gets closed automatically. See https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
Any of the following keywords can be used: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved)
### Description
- [X] Here are some details about my PR, including screenshots of any UI changes:
Downgraded failed remove log in `ZkBaseDataAcessor` from `Log.debug` to `Log.info`. This log error shows when there is an attempt to delete a parent ZNode with non-empty children. However, it automatically calls another function that recursively deletes the children of the node and in the case this operation is successful, having a stack-trace error from before can confuse users of a problem that is in fact trivial. The same was done in the deletion method itself from `ZkClient`. By downgrading to info, users may still see the error logs but it will minimize the amount of noise cause by these warnings.
There has been an attempt to avoid calling delete in `ZkClient` altogether and just call `deleteRecursively` dependent on the number of children of the node. However, there were no solution thought of that would avoid race conditions and/or extra overhead from calling `getChildren()` multiple times.
### Tests
- [X] The following tests are written for this issue:
Added `testDeleteLogging()` in `TestZkBaseDataAccessor.java`
The test creates a 10 instance message records. It proceeds to call remove on the parent of those children. The test checks whether remove returns true, which it does. However, the purpose of it is to check whether the logs are shown. Going through the debugger, the logs are outputted.
- The following is the result of the "mvn test" command on the appropriate module:
(If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)
### Changes that Break Backward Compatibility (Optional)
- My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:
(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)
### Documentation (Optional)
- In case of new functionality, my PR adds documentation in the following wiki page:
(Link the GitHub wiki you added)
### Commits
- 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
- 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.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
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] qqu0127 commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
qqu0127 commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964106373
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,36 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
Review Comment:
Thanks. In this case, I don't think we need this test at all.
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964152813
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,36 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
Review Comment:
I agree with renaming the tests for better clarity - thanks for the feedback!
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964151848
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
Hmm you're right. What we're looking for is to diminish logging clutter - increasing the logging level would worsen that! I wanted to have the logging level consistent with the log error in the remove function but that wouldn't make sense to the overall objective of this fix. Thanks for the comment!
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on pull request #2201: Modified Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1242561175
> > For line 2069 in [ZkClient.java](https://github.com/apache/helix/pull/2201/files#diff-c20891e1adafdc5bd7c55936d81ec52e84081b76f7df3759da762f932d3f1cae), we should remove `if (LOG.isDebugEnabled()) {` It is redundant.
>
> This is in general to avoid error message computing (if applicable), like format. Not necessarily redundent. But IMO, I think it looks ugly and does not really save much, I vote for removing them : )
Please correct me if I am wrong. I think with the correct log formatter, log4j will do lazily log message construction. We should also do this kind of log improvement for Helix as well....
link:
https://logging.apache.org/log4j/2.x/manual/api.html
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965043782
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2073,7 +2073,7 @@ public Object call() throws Exception {
record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.WRITE);
- LOG.warn("zkclient {}, Failed to delete path {}! ", _uid, path, e);
+ LOG.debug("zkclient {}, Failed to delete path {}! ", _uid, path, e);
Review Comment:
I think the first two parameters are for the positional brackets. The last one since it's an exception it is thrown as a separate message. Let me know if I'm mistaken
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2073,7 +2073,7 @@ public Object call() throws Exception {
record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.WRITE);
- LOG.warn("zkclient {}, Failed to delete path {}! ", _uid, path, e);
+ LOG.debug("zkclient {}, Failed to delete path {}! ", _uid, path, e);
Review Comment:
I think the first two parameters are for the positional brackets. The last one since it's an exception it is thrown as a separate message. Let me know if I'm mistaken!
--
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: reviews-unsubscribe@helix.apache.org
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] qqu0127 commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
qqu0127 commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964145532
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,36 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
Review Comment:
Ok, I see your point. My concern is that, `"make sure the right logging is made"` is checked manually. It doesn't add much value to the unit test in regard to logging. Functionally, it does have value to verify no exception is thrown. So we may keep the test, and rename it to e.g. `testDeleteNodeWithChildren`, just my two cents.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r960910377
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,37 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+ _gZkClient.deleteRecursively("/" + root);
Review Comment:
Also please link the issue number if the description.
--
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: reviews-unsubscribe@helix.apache.org
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] NealSun96 merged pull request #2201: Removed Error Log to Avoid Spam Logging
Posted by GitBox <gi...@apache.org>.
NealSun96 merged PR #2201:
URL: https://github.com/apache/helix/pull/2201
--
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: reviews-unsubscribe@helix.apache.org
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] junkaixue commented on pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
junkaixue commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1238415250
NIT: please remove original template context in the details.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r960909328
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,37 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+ _gZkClient.deleteRecursively("/" + root);
Review Comment:
I might have missed it last time. Why we are deleting everything under root?
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965127001
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
You're right, I made a mistake in the description, thank you for pointing that out! I'll update the description with this feedback.
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965128168
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2073,7 +2073,7 @@ public Object call() throws Exception {
record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.WRITE);
- LOG.warn("zkclient {}, Failed to delete path {}! ", _uid, path, e);
+ LOG.info("zkclient {}, Failed to delete path {}! ", _uid, path, e);
Review Comment:
That is a very good point, thank you!
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r961008838
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,37 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+ _gZkClient.deleteRecursively("/" + root);
Review Comment:
This is to make sure we work with a clean path. However, it might not be necessary now that you point it out.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964206160
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
The aim for this change is to make the log less misleading. By increasing the log level will indicate user that the previous warning log saying failed to remove znode won't be an issue and we will retry remove recursively.
This is only in failure path and won't be causing log flooding.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on pull request #2201: Modified Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1242202153
LGTM. Thanks for making the change.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1238691437
For line 2069 in [ZkClient.java](https://github.com/apache/helix/pull/2201/files#diff-c20891e1adafdc5bd7c55936d81ec52e84081b76f7df3759da762f932d3f1cae), we should remove
`if (LOG.isDebugEnabled()) {`
It is redundant.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on pull request #2201: Modified Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1242556453
>
Please correct me if I am wrong. The this kind of log formatter, log4j is already doing lazily log construction. So we will only do string construction when the log level<= debug.
https://logging.apache.org/log4j/2.0/manual/api.html#Java_8_lambda_support_for_lazy_logging
--
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: reviews-unsubscribe@helix.apache.org
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] qqu0127 commented on pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
qqu0127 commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1233409391
Hi Marcos, one quick thing, we don't post internal ticket to github, it's not accessible to outside world anyway. Please use github issue instead.
--
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: reviews-unsubscribe@helix.apache.org
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] rahulrane50 commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
rahulrane50 commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964451422
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2073,7 +2073,7 @@ public Object call() throws Exception {
record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.WRITE);
- LOG.warn("zkclient {}, Failed to delete path {}! ", _uid, path, e);
+ LOG.debug("zkclient {}, Failed to delete path {}! ", _uid, path, e);
Review Comment:
Umm is this correct? There are 3 parameters for 2 positional brackets.
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
neat : I understand the overall intention of changing this to INFO level but I would be very cautious about this change since this is very core method which is used in many places. Any small changes in logging here would flood logs in specific scenarios. Also could you help me understand why was the "debug" log noise in the first place. It shouldn't even show up in logs unless debug logging is enabled right? (I assume debug logging is disabled 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.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964124311
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,36 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
Review Comment:
I might have phrased my answer wrong. The test does check whether zk catches the error of removing a parent node with children, which I believe is not tested elsewhere, though not sure if that is considered as delete functionality. The primary motive for the test is to catch this error and make sure the right logging is made. Perhaps that is not necessary given the variable nature of log configs - let me know, thanks!
--
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: reviews-unsubscribe@helix.apache.org
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] jiajunwang commented on pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
jiajunwang commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1239710309
> For line 2069 in [ZkClient.java](https://github.com/apache/helix/pull/2201/files#diff-c20891e1adafdc5bd7c55936d81ec52e84081b76f7df3759da762f932d3f1cae), we should remove `if (LOG.isDebugEnabled()) {` It is redundant.
This is in general to avoid error message computing (if applicable), like format. Not necessarily redundent. But IMO, I think it looks ugly and does not really save much, I vote for removing them : )
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965123531
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2073,7 +2073,7 @@ public Object call() throws Exception {
record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.WRITE);
- LOG.warn("zkclient {}, Failed to delete path {}! ", _uid, path, e);
+ LOG.info("zkclient {}, Failed to delete path {}! ", _uid, path, e);
Review Comment:
+1 on this.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r960029720
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,29 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+ _gZkClient.deleteRecursively("/" + root);
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
+
+ // CreateChildren
+ List<ZNRecord> records = new ArrayList<>();
+ List<String> paths = new ArrayList<>();
+ for (int i = 0; i < 10; i++) {
+ String msgId = "msg_" + i;
+ paths.add(PropertyPathBuilder.instanceMessage(root, "host_1", msgId));
+ records.add(new ZNRecord(msgId));
+ }
+ boolean[] success = accessor.createChildren(paths, records, AccessOption.PERSISTENT);
+
+ // Attempt to remove parent. Shouldn't throw an error or warning log.
+ // Should return True if recursive deletion succeeds.
+ Assert.assertTrue(accessor.remove(PropertyPathBuilder.instanceMessage(root, "host_1"), 0),
+ "Should return True despite log errors.");
+ }
+
Review Comment:
Thanks for making this change!!
I would suggest validate that these ZNode has already being deleted.
--
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: reviews-unsubscribe@helix.apache.org
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] NealSun96 commented on pull request #2201: Modified Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
NealSun96 commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1242352958
CI workflows approved.
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965032828
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
I am not too familiar with what the default logging is for the different applications of these methods. However, the ticket and issue created arose from customers (i.e. Venice) who have run into the issue of these "noisy" logs. Ideally, we would want to completely avoid calling these logs altogether (in the case that deletion succeeds further on). However, we weren't able to come up with a liable solution. Thus, if the log error is to be shown regardless, the purpose of this change as Xiaoyuan mentioned is to make it less misleading. Let me know what you think!
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r964083916
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,36 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
Review Comment:
Correct, this is just to check that the specific logging message is displayed. I believe delete functionality is tested in `TestZkBaseDataAccessor.testAsyncZkBaseDataAccessor()`
--
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: reviews-unsubscribe@helix.apache.org
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] jiajunwang commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
jiajunwang commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965103623
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
I'm confused here.
If set the log level to info, then orignal code will NOT print debug log, but the new change will be printing more logs. It contradicts to the description.
> A log request of level p in a logger with level q is enabled if p >= q. This rule is at the heart of log4j. It assumes that levels are ordered. For the standard levels, we have ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF.
Here, in the original code p == debug and q == info. So the log won't be printed.
Debug to Info is considered upgrade instead of downgrade.
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
I'm confused here.
If set the log level to info, then orignal code will NOT print debug log, but the new change will be printing more logs. It contradicts to the description.
> A log request of level p in a logger with level q is enabled if p >= q. This rule is at the heart of log4j. It assumes that levels are ordered. For the standard levels, we have ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF.
Here, in the original code p == debug and q == info. So the log won't be printed.
Debug to Info is considered upgrade instead of downgrade.
--
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: reviews-unsubscribe@helix.apache.org
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] jiajunwang commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
jiajunwang commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r965107256
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2073,7 +2073,7 @@ public Object call() throws Exception {
record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.WRITE);
- LOG.warn("zkclient {}, Failed to delete path {}! ", _uid, path, e);
+ LOG.info("zkclient {}, Failed to delete path {}! ", _uid, path, e);
Review Comment:
Since exception is thrown, we don't really need to log it. I would suggest to get rid of this line completely to resolve the concern.
I would be great to revisit all the similar spots too.
1. If error will be thrown, no need to log. The caller can log if necessary.
2. If the error will be handled within the method, then log properly assuming it provides additional information.
--
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: reviews-unsubscribe@helix.apache.org
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] qqu0127 commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
qqu0127 commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r963972631
##########
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
##########
@@ -726,7 +726,7 @@ public boolean remove(String path, int options) {
// case, we try to delete recursively
_zkClient.delete(path);
} catch (ZkException e) {
- LOG.debug("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
+ LOG.info("Failed to delete {} with opts {}, err: {}. Try recursive delete", path, options,
Review Comment:
Just FYI, change from debug to info is a up-level. We may see more logs like this, is this what we want? (most default log level is at INFO or plus)
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,36 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+
+ ZkBaseDataAccessor<ZNRecord> accessor = new ZkBaseDataAccessor<>(_gZkClient);
Review Comment:
Thanks for writing up the test.
Logging test can be tricky, it depends on the configuration of log level in test environment, and there isn't a good way to verify the log message.
If I understand correctly, this test is only to test logging, but not to test the delete functionality?
--
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: reviews-unsubscribe@helix.apache.org
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] Marcosrico commented on pull request #2201: Removed Error Log to Avoid Spam Logging
Posted by GitBox <gi...@apache.org>.
Marcosrico commented on PR #2201:
URL: https://github.com/apache/helix/pull/2201#issuecomment-1244045621
This PR is ready to merge, approved by @xyuanlu
Failed tests are not stable and pass locally. See description for test results.
Commit message:
Removed Error Log to Avoid Spam Logging
Removed an unnecessary and misleading error log in ZkClient. This cleans up the logging and avoids clutter.
--
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: reviews-unsubscribe@helix.apache.org
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] xyuanlu commented on a diff in pull request #2201: Downgraded Deletion Error Logs to Avoid Error Spam Logging
Posted by GitBox <gi...@apache.org>.
xyuanlu commented on code in PR #2201:
URL: https://github.com/apache/helix/pull/2201#discussion_r961166760
##########
helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java:
##########
@@ -433,6 +433,37 @@ public void testSyncRemove() {
System.out.println("END " + testName + " at " + new Date(System.currentTimeMillis()));
}
+ @Test
+ public void testDeleteLogging() {
+ String root = _rootPath;
+ _gZkClient.deleteRecursively("/" + root);
Review Comment:
We probably do not want to touch other ZNodes as it may impact other tests in this test class.
--
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: reviews-unsubscribe@helix.apache.org
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