vladimirivic commented on a change in pull request #1034: ZOOKEEPER-3491 
Specify commitLogCount value using a system property
URL: https://github.com/apache/zookeeper/pull/1034#discussion_r322836668
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java
 ##########
 @@ -120,6 +124,23 @@ public ZKDatabase(FileTxnSnapLog snapLog) {
             snapshotSizeFactor = DEFAULT_SNAPSHOT_SIZE_FACTOR;
         }
         LOG.info("{} = {}", SNAPSHOT_SIZE_FACTOR, snapshotSizeFactor);
+
+        try {
+            commitLogCount = Integer.parseInt(
+                    System.getProperty(COMMIT_LOG_COUNT,
+                            Integer.toString(DEFAULT_COMMIT_LOG_COUNT)));
+            if (commitLogCount < DEFAULT_COMMIT_LOG_COUNT) {
+                commitLogCount = DEFAULT_COMMIT_LOG_COUNT;
+                LOG.warn("The configured commitLogCount {} is less than the 
recommended {}"
 
 Review comment:
   I can create another PR to update the docs and make sure I say the value is 
the recommended minimum and that it defaults to 500. As for the risk of using a 
lower value, I am guessing @enixon wanted to make sure we have some limit that 
reflects a well known best practice. 
   
   Should I change that? I personally like that we have some safety enforcement 
around the config values. 

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


With regards,
Apache Git Services

Reply via email to