ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1263 fix handling of min/max session timeout value initialization
  3. ZOOKEEPER-1213

ZooKeeper server startup fails if configured only with the 'minSessionTimeout' and not 'maxSessionTimeout'

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.5.0
    • Component/s: server
    • Labels:
      None

      Description

      I have configured only the 'minSessionTimeout' and not configured 'maxSessionTimeout' in the zoo.cfg file as follows

      zoo.cfg

      tickTime=2000
      minSessionTimeout=10000

      I'm seeing the following exception and not starting the ZooKeeper server

      2011-10-07 23:39:10,546 - INFO  [main:QuorumPeerConfig@100] - Reading configuration from: /home/rakeshr/zookeeper/bin/../conf/zoo.cfg
      2011-10-07 23:39:12,334 - ERROR [main:QuorumPeerMain@85] - Invalid config, exiting abnormally
      org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /home/rakeshr/zookeeper/bin/../conf/zoo.cfg
      	at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:120)
      	at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
      	at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
      Caused by: java.lang.IllegalArgumentException: minSessionTimeout must not be larger than maxSessionTimeout
      	at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:265)
      	at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:116)
      	... 2 more
      

      Startup fails due to the following validation. Here maxSessionTimeout value is -1 rather than the upper limit (tickTime * 2)

               /** defaults to -1 if not set explicitly */
               protected int maxSessionTimeout = -1;
      
              if (minSessionTimeout > maxSessionTimeout) {
                  throw new IllegalArgumentException(
                          "minSessionTimeout must not be larger than maxSessionTimeout");
              }
      

        Issue Links

          Activity

          Hide
          Michi Mutsuzaki added a comment -

          ZOOKEEPER-1263 is fixed.

          Show
          Michi Mutsuzaki added a comment - ZOOKEEPER-1263 is fixed.
          Hide
          Patrick Hunt added a comment -

          Rolled this up to ZOOKEEPER-1263, close this when ZOOKEEPER-1263 is closed.

          Show
          Patrick Hunt added a comment - Rolled this up to ZOOKEEPER-1263 , close this when ZOOKEEPER-1263 is closed.
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12497754/ZOOKEEPER-1213.patch
          against trunk revision 1177432.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 6 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/602//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/602//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/602//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12497754/ZOOKEEPER-1213.patch against trunk revision 1177432. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/602//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/602//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/602//console This message is automatically generated.
          Hide
          Rakesh R added a comment -

          IMO we can initialize the maxSessionTimeout with the upper limit as follows.

                  if (maxSessionTimeout == -1) {
          		maxSessionTimeout = tickTime * 20;
          	}
          

          I'll soon upload the patch with this changes.

          Show
          Rakesh R added a comment - IMO we can initialize the maxSessionTimeout with the upper limit as follows. if (maxSessionTimeout == -1) { maxSessionTimeout = tickTime * 20; } I'll soon upload the patch with this changes.

            People

            • Assignee:
              Rakesh R
              Reporter:
              Rakesh R
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development