When I did testing ZooKeeper 3.4.5, I found an implicit and slight
restriction of snapCount.
If snapCount is set to 1, ZooKeeper Server can start but it fails with the
2013-10-02 18:09:07,600 [myid:1] - ERROR
[SyncThread:1:SyncRequestProcessor@151] - Severe unrecoverable error,
java.lang.IllegalArgumentException: n must be positive
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 of
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
But, it may be better to mention this restriction in documentation or add a
validation in the source code.