maoling commented on code in PR #1906:
URL: https://github.com/apache/zookeeper/pull/1906#discussion_r1477780625


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java:
##########
@@ -506,6 +525,11 @@ public void createNode(final String path, byte[] data, 
List<ACL> acl, long ephem
             if (outputStat != null) {
                 child.copyStat(outputStat);
             }
+            childNodeCount = parent.getChildren().size();
+        }
+        if (maxChildCountThreshold > 0 && childNodeCount > 
maxChildCountThreshold) {
+            LOG.warn("Child node count is " + childNodeCount + " crossing the 
threshold value of " +
+                    maxChildCountThreshold + ". Parent node path is " + 
parentName);

Review Comment:
   use the following log format. e.g:
   
   > LOG.warn("Found child node with improper name: {}", childName);



##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java:
##########
@@ -300,6 +303,20 @@ public DataTree() {
 
         addConfigNode();
 
+        /**
+         * throw warning if child node count is more the maxChildCountThreshold
+         * this will help to detect overpopulated znodes
+         */
+        String mcct = System.getProperty("zookeeper.maxChildCountThreshold");
+        if (mcct != null && !mcct.isEmpty()) {

Review Comment:
   - add a doc to `zookeeperAdmin.md` for this new property
   - Make the parse of property concise. e.g: 
   
   > private static final long rateLimiterInterval = 
Integer.parseInt(System.getProperty(ADMIN_RATE_LIMITER_INTERVAL, "300000"));



-- 
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: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to