[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Takashi Ohnishi updated ZOOKEEPER-1781:
---------------------------------------

    Description: 
If snapCount is set to 1, ZooKeeper Server can start but it fails with the 
below error:

2013-10-02 18:09:07,600 [myid:1] - ERROR 
[SyncThread:1:SyncRequestProcessor@151] - Severe unrecoverable error, exiting
java.lang.IllegalArgumentException: n must be positive
        at java.util.Random.nextInt(Random.java:300)
        at 
org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:93)

In source code,  it maybe be supposed that snapCount must be 2 or more:
     91             // we do this in an attempt to ensure that not all ofthe 
servers
     92             // in the ensemble take a snapshot at the same time
     93             int randRoll = r.nextInt(snapCount/2);

I think this supposition is not bad because snapCount = 1 is not realistic 
setting...
But, it may be better to mention this restriction in documentation or add a 
validation in the source code.

  was:
If snapCount is set to 1, ZooKeeper Server can start but it fails with the 
below error:

2013-10-02 18:09:07,600 [myid:1] - ERROR 
[SyncThread:1:SyncRequestProcessor@151] - Severe unrecoverable error, exiting
java.lang.IllegalArgumentException: n must be positive
        at java.util.Random.nextInt(Random.java:300)
        at
org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:93)

In source code,  it maybe be supposed that snapCount must be 2 or more:
     91             // we do this in an attempt to ensure that not all ofthe 
servers
     92             // in the ensemble take a snapshot at the same time
     93             int randRoll = r.nextInt(snapCount/2);

I think this supposition is not bad because snapCount = 1 is not realistic 
setting...
But, it may be better to mention this restriction in documentation or add a 
validation in the source code.


> ZooKeeper Server fails if snapCount is set to 1 
> ------------------------------------------------
>
>                 Key: ZOOKEEPER-1781
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1781
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.4.5
>            Reporter: Takashi Ohnishi
>            Priority: Minor
>
> If snapCount is set to 1, ZooKeeper Server can start but it fails with the 
> below error:
> 2013-10-02 18:09:07,600 [myid:1] - ERROR 
> [SyncThread:1:SyncRequestProcessor@151] - Severe unrecoverable error, exiting
> java.lang.IllegalArgumentException: n must be positive
>         at java.util.Random.nextInt(Random.java:300)
>         at 
> org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:93)
> In source code,  it maybe be supposed that snapCount must be 2 or more:
>      91             // we do this in an attempt to ensure that not all ofthe 
> servers
>      92             // in the ensemble take a snapshot at the same time
>      93             int randRoll = r.nextInt(snapCount/2);
> I think this supposition is not bad because snapCount = 1 is not realistic 
> setting...
> But, it may be better to mention this restriction in documentation or add a 
> validation in the source code.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to