zookeeper.git
28 hours agoZOOKEEPER-3277: Add trace listener in NettyServerCnxnFactory only if trace logging... master
Ilya Maykov [Fri, 15 Feb 2019 14:36:55 +0000 (15:36 +0100)] 
ZOOKEEPER-3277: Add trace listener in NettyServerCnxnFactory only if trace logging is enabled

Based on the code review discussion in #819

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #820 from ivmaykov/ZOOKEEPER-3277

31 hours agoFix ant package target: pom.template, zooinspector
Andor Molnar [Fri, 15 Feb 2019 11:39:38 +0000 (12:39 +0100)] 
Fix ant package target: pom.template, zooinspector

Quick fix for the release process.

Author: Andor Molnar <andor@apache.org>

Reviewers: nkalmar@yahoo.com, eolivelli@gmail.com

Closes #821 from anmolnar/fix_package and squashes the following commits:

170acfd2d [Andor Molnar] Added copy pom.template task to bin-package target
fe0b95b46 [Andor Molnar] Fix ant package target: pom.template, zooinspector

3 days agoZOOKEEPER-3239: Adding EnsembleAuthProvider to verify the ensemble name
Jie Huang [Wed, 13 Feb 2019 12:19:28 +0000 (13:19 +0100)] 
ZOOKEEPER-3239: Adding EnsembleAuthProvider to verify the ensemble name

Author: Jie Huang <jiehuang@fb.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #768 from jhuan31/ZOOKEEPER-3239 and squashes the following commits:

7e17e1b8a [Jie Huang] add doc for EnsembleAuthProvider
878bfb543 [Jie Huang] ZOOKEEPER-3239: Adding EnsembleAuthProvider to verify the ensemble name

3 days agoZOOKEEPER-974: Allow a configurable ZooKeeper server socket listen ba…
Josh Elser [Wed, 13 Feb 2019 12:12:00 +0000 (13:12 +0100)] 
ZOOKEEPER-974: Allow a configurable ZooKeeper server socket listen ba…

…cklog

Introduces configuration property "clientPortBacklog". Amendment of
original patch from "Hoonmin Kim".

Author: Josh Elser <elserj@apache.org>

Reviewers: andor@apache.org

Closes #784 from joshelser/974-master and squashes the following commits:

fe5f66a5a [Josh Elser] Add some documentation for the new property
be61d1c5f [Josh Elser] Feedback from Andor
3ed36f824 [Josh Elser] Update 'conf' 4lw for clientPortListenBacklog
fd249939c [Josh Elser] ZOOKEEPER-974: Allow a configurable ZooKeeper server socket listen backlog

3 days agoZOOKEEPER-3275: Fix release targets: package, tar, mvn-deploy
Andor Molnar [Tue, 12 Feb 2019 20:01:41 +0000 (21:01 +0100)] 
ZOOKEEPER-3275: Fix release targets: package, tar, mvn-deploy

Fixed recipes and contrib path names for package and tar targets.

Author: Andor Molnar <andor@apache.org>

Reviewers: andor@apache.org

Closes #817 from anmolnar/ZOOKEEPER-3275 and squashes the following commits:

64db892af [Andor Molnar] ZOOKEEPER-3275. Fixed bin-package target
e8ad3d483 [Andor Molnar] ZOOKEEPER-3275. Added pom.xml to tar file, fixed mvn-deploy task
6667c2ff0 [Andor Molnar] ZOOKEEPER-3275. Updated release audit warnings exlcudes
5abf3b444 [Andor Molnar] ZOOKEEPER-3275. Fixed path of contrib and docs project
4e97ae8a7 [Andor Molnar] ZOOKEEPER-3275. Fixed recipes folders in ant package target

4 days agoZOOKEEPER-3276: Make X509UtilTest.testCreateSSLServerSocketWithPort less flaky
Ilya Maykov [Tue, 12 Feb 2019 14:31:55 +0000 (15:31 +0100)] 
ZOOKEEPER-3276: Make X509UtilTest.testCreateSSLServerSocketWithPort less flaky

Pick the free port right before using it, so there is less time for another thread/process to grab it from under us.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #816 from ivmaykov/ZOOKEEPER-3276

4 days agoFix typos in index.md
tison [Tue, 12 Feb 2019 14:29:53 +0000 (15:29 +0100)] 
Fix typos in index.md

Author: tison <wander4096@gmail.com>

Reviewers: andor@apache.org

Closes #812 from TisonKun/document_2

4 days agoFix typos in javaExample.md
tison [Tue, 12 Feb 2019 14:28:16 +0000 (15:28 +0100)] 
Fix typos in javaExample.md

Also breaks some long lines, which I'm not sure if approved.

Author: tison <wander4096@gmail.com>

Reviewers: andor@apache.org

Closes #811 from TisonKun/document_1

4 days agoZOOKEEPER-3272: Clean up netty4 code per Norman Maurer's review comments
Ilya Maykov [Tue, 12 Feb 2019 14:25:17 +0000 (15:25 +0100)] 
ZOOKEEPER-3272: Clean up netty4 code per Norman Maurer's review comments

Netty4 code clean-up per the discussion in PR #753.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: norman_maurer@apple.com, andor@apache.org

Closes #809 from ivmaykov/ZOOKEEPER-3272 and squashes the following commits:

26d2b338f [Ilya Maykov] Merge branch 'master' into ZOOKEEPER-3272
201449641 [Ilya Maykov] Address code review comments
a162c54b0 [Ilya Maykov] ZOOKEEPER-3272: Clean up netty4 code per Norman Maurer's review comments

5 days agoZOOKEEPER-3028: MAVEN MIGRATION - - Create maven assembly
Norbert Kalmar [Mon, 11 Feb 2019 11:34:42 +0000 (12:34 +0100)] 
ZOOKEEPER-3028: MAVEN MIGRATION - - Create maven assembly

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: andor@apache.org

Closes #776 from nkalmar/ZK-3028 and squashes the following commits:

c255d2503 [Norbert Kalmar] ZOOKEEPER-3028 - fix javadoc warnings
b6ec90e11 [Norbert Kalmar] ZOOKEEPER-3028 - fix log4j.properties problem not getting into target
a54e49b49 [Norbert Kalmar] ZOOKEEPER-3028 - Remove empty test jar generation
be73ead6b [Norbert Kalmar] ZOOKEEPER-3028 - update README.md
d81a586bd [Norbert Kalmar] ZOOKEEPER-3028 update relese procedures
42389350e [Norbert Kalmar] ZOOKEEPER-3028 - Add maven release procedure to readme.md
dc3ab0152 [Norbert Kalmar] ZOOKEEPER-3028 - fix jars, add javadoc jar
07dfcf2d9 [Norbert Kalmar] ZOOKEEPER-3028 - move assembly descriptor
e22c708c3 [Norbert Kalmar] ZOOKEEPER-3028 - fix tarball to contain buildable source
859dfb949 [Norbert Kalmar] ZOOKEEPER-3028 add apache release
46c2f93bf [Norbert Kalmar] ZOOKEEPER-3028 add release plugin
8c56e3c70 [Norbert Kalmar] ZOOKEEPER-3028 - Create maven assembly

9 days agoZOOKEEPER-3167: add an API and the corresponding CLI to get total count of recursive...
maoling [Thu, 7 Feb 2019 10:26:08 +0000 (11:26 +0100)] 
ZOOKEEPER-3167: add an API and the corresponding CLI to get total count of recursive sub nodes under a specific path

- Thanks the original patch from [TyqITstudent ](https://github.com/TyqITstudent).
- the `getAllChildrenNumber` api supports `sync` and `async`, don't support `watch`.
  since` getChildren()` can get the number of the first level,to keep the api short and clean,don't use a boolean flag to let this api get the number of the first level child.
- the implements using the` parallelStream()` which have the almost `4x` speed up than `forEach`(I test),it will return at once even a millons of keys.
- `getAllChildrenNumber` doesn't have a `synchronized `lock, to avoid holding the `nodes` for a long time,so when too many concurrent writes, the number will be not very precise.
- about `getAllChildrenNumber` CLI:

    > [zk: localhost:2181(CONNECTED) 6] getAllChildrenNumber /zookeeper
    >  2
    >  [zk: localhost:2181(CONNECTED) 7] getAllChildrenNumber /zookeeper/quota
    >  0

- there is no good place to document the new api, I create a seperate jira-[ZOOKEEPER-3259](https://issues.apache.org/jira/projects/ZOOKEEPER/issues/ZOOKEEPER-3259).

Author: maoling <maoling199210191@sina.com>

Reviewers: andor@apache.org

Closes #790 from maoling/ZOOKEEPER-3167

9 days agoZOOKEEPER-2892: Improve lazy initialize and close stream for `PrepRequestProcessor`
asdf2014 [Thu, 7 Feb 2019 10:22:55 +0000 (11:22 +0100)] 
ZOOKEEPER-2892: Improve lazy initialize and close stream for `PrepRequestProcessor`

Improve lazy initialize and close stream for `PrepRequestProcessor`

* Delay the initialization of `ChangeRecord` and `ReconfigRequest` variables
* Close the `ByteArrayOutputStream` I/O stream

hanm PTAL

Author: asdf2014 <benedictjin2016@gmail.com>

Reviewers: hanm@apache.org, andor@apache.org

Closes #361 from asdf2014/ZOOKEEPER-2892

9 days agoZOOKEEPER-3273: Sync BouncyCastle version in Maven build and Ant build
Enrico Olivelli [Thu, 7 Feb 2019 10:20:05 +0000 (11:20 +0100)] 
ZOOKEEPER-3273: Sync BouncyCastle version in Maven build and Ant build

Uee 1.60 in Ant, the same version used in Maven

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: andor@apache.org

Closes #808 from eolivelli/fix/ZOOKEEPER-3273

9 days agoFix typos in zookeeperOver.md
tison [Thu, 7 Feb 2019 10:15:16 +0000 (11:15 +0100)] 
Fix typos in zookeeperOver.md

Author: tison <wander4096@gmail.com>

Reviewers: andor@apache.org

Closes #807 from TisonKun/document_0

9 days agoZOOKEEPER-3234: Add Travis-CI configuration file
Enrico Olivelli [Thu, 7 Feb 2019 10:12:44 +0000 (11:12 +0100)] 
ZOOKEEPER-3234: Add Travis-CI configuration file

Author: Enrico Olivelli <eolivelli@apache.org>
Author: Enrico Olivelli <eolivelli@gmail.com>

Reviewers: andor@apache.org

Closes #751 from eolivelli/fix/travis and squashes the following commits:

bbfcfe5c1 [Enrico Olivelli] More memory
a9de203d5 [Enrico Olivelli] Update .travis.yml
f9fbd3aa8 [Enrico Olivelli] Add travis_wait
075f9c32f [Enrico Olivelli] Enable IPv6
85083d27b [Enrico Olivelli] Perform fsync
7ce12ff1d [Enrico Olivelli] Forkcount = 4
6607343e4 [Enrico Olivelli] Fix forkcount
043aa40bd [Enrico Olivelli] Do not force fsync and use 1 thread for tests
bf1384352 [Enrico Olivelli] ZOOKEEPER-3234: Add Travis-CI configuration file

10 days agoZOOKEEPER-1392: Request READ or ADMIN permission for getAcl()
Andor Molnar [Wed, 9 Jan 2019 16:22:40 +0000 (17:22 +0100)] 
ZOOKEEPER-1392: Request READ or ADMIN permission for getAcl()

10 days agoZOOKEEPER-3269: Add queueEvent to the Testable facade
randgalt [Wed, 6 Feb 2019 08:46:37 +0000 (09:46 +0100)] 
ZOOKEEPER-3269: Add queueEvent to the Testable facade

Add queueEvent to the Testable facade to enabled inserting events into the clients queue.

For testing and other reasons it would be very useful to add a way to inject an event into ZooKeeper's event queue. ZooKeeper already has the Testable for features such as this (low level, backdoor, testing, etc.). This queueEvent method would be particularly helpful to Apache Curator and we'd very much appreciate its inclusion.

Author: randgalt <jordan@jordanzimmerman.com>

Reviewers: andor@apache.org

Closes #799 from Randgalt/ZOOKEEPER-3269 and squashes the following commits:

0e3ab80a0 [randgalt] ZOOKEEPER-3269 - use explicit imports
f77574be1 [randgalt] ZOOKEEPER-3269 remove IDE introduced spacing changes
8b5222daf [randgalt] ZOOKEEPER-3269

12 days agoZOOKEEPER-3265: Fix fileset to match shell scripts and python files i…
Zsombor Gegesy [Mon, 4 Feb 2019 16:08:49 +0000 (17:08 +0100)] 
ZOOKEEPER-3265: Fix fileset to match shell scripts and python files i…

…n contrib directory.

Author: Zsombor Gegesy <zsombor@apache.org>

Reviewers: andor@apache.org

Closes #798 from gzsombor/ZOOKEEPER-3265-master

2 weeks agoZOOKEEPER-3262: Update dependencies flagged by OWASP report
Enrico Olivelli [Sat, 2 Feb 2019 18:59:45 +0000 (10:59 -0800)] 
ZOOKEEPER-3262: Update dependencies flagged by OWASP report

- Upgrade Jetty to 9.4.14.v20181114
- Upgrade Jackson to 2.9.8
- Suppress a false positive about Netty  (https://github.com/jeremylong/DependencyCheck/issues/1653)
- Suppress false positives against ZooKeeper itself: CVE-2018-8012 and  CVE-2016-5017

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: phunt@apache.org

Closes #792 from eolivelli/fix/ZOOKEEPER-3262

Change-Id: I6152ee061765a6eb7e4b9ac19db79d11bee4f4c5

2 weeks agoZOOKEEPER-2826: Code refactoring for `CLI` module
asdf2014 [Thu, 31 Jan 2019 14:55:07 +0000 (15:55 +0100)] 
ZOOKEEPER-2826: Code refactoring for `CLI` module

* Fix spell issues
* Remove unnecessary `import`
* Make initialization block that related with `options.addOption` into static
* Standardize `StringBuilder#append` usage
* Using `try` clause to release the resource of stream

Author: asdf2014 <benedictjin2016@gmail.com>

Reviewers: andor@apache.org

Closes #298 from asdf2014/ZOOKEEPER-2826

2 weeks agoZOOKEEPER-2825: 1. Remove unnecessary import; 2. `contains` instead of `indexOf ...
asdf2014 [Thu, 31 Jan 2019 14:50:59 +0000 (15:50 +0100)] 
ZOOKEEPER-2825: 1. Remove unnecessary import; 2. `contains` instead of `indexOf > -1` for more readable; 3. Standardize `StringBuilder#append` usage for CLIENT module

* Remove unnecessary import;
* `contains` instead of `indexOf > -1` for more readable;
* Standardize `StringBuilder#append` usage for CLIENT module

Author: asdf2014 <benedictjin2016@gmail.com>

Reviewers: afine@apache.org, andor@apache.org

Closes #297 from asdf2014/ZOOKEEPER-2825

2 weeks agoZOOKEEPER-3238: Adding noreferrer to target blank link
Colm O hEigeartaigh [Thu, 31 Jan 2019 13:18:06 +0000 (14:18 +0100)] 
ZOOKEEPER-3238: Adding noreferrer to target blank link

In zookeeper-contrib-huebrowser, there is a link that uses target="_blank". Best security practise is to also add rel="noopener noreferrer". See for example: https://dev.to/ben/the-targetblank-vulnerability-by-example.

Note I did not test this as I do not use hue. However it is a fairly trivial change.

Author: Colm O hEigeartaigh <coheigea@apache.org>

Reviewers: andor@apache.org

Closes #762 from coheigea/add_noreferrer

2 weeks agoZOOKEEPER-3251: Add new server metric types - fix Maven build
Enrico Olivelli [Thu, 31 Jan 2019 10:47:58 +0000 (11:47 +0100)] 
ZOOKEEPER-3251: Add new server metric types - fix Maven build

Add Dropwizard dependency on Maven configuration files in order to make the build work on Maven

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: andor@apache.org

Closes #793 from eolivelli/fix/fix-build-maven

2 weeks agoZOOKEEPER-3257: Merge count and byte update of Stat
Brian Nixon [Wed, 30 Jan 2019 16:02:39 +0000 (17:02 +0100)] 
ZOOKEEPER-3257: Merge count and byte update of Stat

Author: Brian Nixon <nixon@fb.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #789 from enixon/count-and-byte and squashes the following commits:

428c12925 [Brian Nixon] remove stray comment
a1c755574 [Brian Nixon] ZOOKEEPER-3257: Merge count and byte update of Stat

2 weeks agoZOOKEEPER-3251: Add new server metric types: percentile counter and c…
Jie Huang [Wed, 30 Jan 2019 15:43:22 +0000 (16:43 +0100)] 
ZOOKEEPER-3251: Add new server metric types: percentile counter and c…

…ounter set

Author: Jie Huang <jiehuang@fb.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #781 from jhuan31/ZOOKEEPER-3251 and squashes the following commits:

c3f4f7f40 [Jie Huang] Make new unit test classes extend ZKTestCase
50a631f54 [Jie Huang] Add Apache license header
e9b7c9500 [Jie Huang] ZOOKEEPER-3251: Add new server metric types: percentile counter and counter set

2 weeks agoZOOKEEPER-3249: Avoid reverting the cversion and pzxid during replaying txns with...
Fangmin Lyu [Wed, 30 Jan 2019 15:28:55 +0000 (16:28 +0100)] 
ZOOKEEPER-3249: Avoid reverting the cversion and pzxid during replaying txns with fuzzy snapshot

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: andor@apache.org

Closes #780 from lvfangmin/ZOOKEEPER-3249

2 weeks agoRevert "ZOOKEEPER-3240: Close socket on Learner shutdown to avoid dangling so…"
Andor Molnar [Wed, 30 Jan 2019 10:43:37 +0000 (11:43 +0100)] 
Revert "ZOOKEEPER-3240: Close socket on Learner shutdown to avoid dangling so…"

This reverts commit de7b87cd69dfd38787270c71f00576f9a235e582.

2 weeks agoZOOKEEPER-3240: Close socket on Learner shutdown to avoid dangling so…
Brian Nixon [Tue, 29 Jan 2019 15:31:58 +0000 (16:31 +0100)] 
ZOOKEEPER-3240: Close socket on Learner shutdown to avoid dangling so…

…cket

Author: Brian Nixon <nixon@fb.com>

Reviewers: hanm@apache.org, andor@apache.org

Closes #767 from enixon/learner-close-socket

2 weeks agoZOOKEEPER-3236: Upgrade BouncyCastle
Colm O hEigeartaigh [Tue, 29 Jan 2019 15:08:22 +0000 (16:08 +0100)] 
ZOOKEEPER-3236: Upgrade BouncyCastle

Author: Colm O hEigeartaigh <coheigea@apache.org>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #757 from coheigea/bouncycastle

2 weeks agoFix typos
Jingguo Yao [Tue, 29 Jan 2019 14:57:36 +0000 (15:57 +0100)] 
Fix typos

I think that this change is too trivial to need a JIRA issue. If a JIRA issue is needed, i can create it.

Author: Jingguo Yao <yaojingguo@gmail.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #777 from yaojingguo/fix-typos

2 weeks agoZOOKEEPER-3256: Enable OWASP checks to Maven build
Enrico Olivelli [Tue, 29 Jan 2019 14:17:46 +0000 (15:17 +0100)] 
ZOOKEEPER-3256: Enable OWASP checks to Maven build

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: andor@apache.org

Closes #788 from eolivelli/fix/owasp and squashes the following commits:

972ff67bf [Enrico Olivelli] Update ant task defs and force update of patterns
bd96cb669 [Enrico Olivelli] ZOOKEEPER-3256: Enable OWASP checks  to Maven build

2 weeks agoZOOKEEPER-3250: typo in doc - zookeeperInternals
lwjli [Tue, 29 Jan 2019 14:14:18 +0000 (15:14 +0100)] 
ZOOKEEPER-3250: typo in doc - zookeeperInternals

"has long as" -> "as long as"

Author: lwjli <liwenjie.thu07@gmail.com>

Reviewers: andor@apache.org

Closes #782 from lwjli/ZOOKEEPER-3250

3 weeks agoZOOKEEPER-3229: [TLS] add AES-256 ciphers to default cipher list
Ilya Maykov [Fri, 25 Jan 2019 13:37:30 +0000 (14:37 +0100)] 
ZOOKEEPER-3229: [TLS] add AES-256 ciphers to default cipher list

- Add AES-256 cipher suites
- Add AES-128-...-SHA cipher suites (for compatibility with Netty OpenSSL transport)
- code cleanup: split up the suites into CBC and GCM ciphers and put them in different order when constructing java8 / java9 defaults.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #744 from ivmaykov/ZOOKEEPER-3229

3 weeks agoZOOKEEPER-3160: Custom User SSLContext
Alex Rankin [Fri, 25 Jan 2019 13:32:24 +0000 (14:32 +0100)] 
ZOOKEEPER-3160: Custom User SSLContext

This is a master branch version of: https://github.com/apache/zookeeper/pull/654

The previous PR was for branch 3.5, and couldn't be merged as that branch is closed for new features.

The Zookeeper libraries currently allow you to set up your SSL Context via system properties such as "zookeeper.ssl.keyStore.location" in the X509Util. This covers most simple use cases, where users have software keystores on their harddrive.

There are, however, a few additional scenarios that this doesn't cover. Two possible ones would be:

1. The user has a hardware keystore, loaded in using PKCS11 or something similar.
2. The user has no access to the software keystore, but can retrieve an already-constructed SSLContext from their container.

For this, I would propose that the X509Util be extended to allow a user to set a property "zookeeper.ssl.client.context" to provide a class which supplies a custom SSL context. This gives a lot more flexibility to the ZK client, and allows the user to construct the SSLContext in whatever way they please (which also future proofs the implementation somewhat).

I added a few simple tests to this class around setting the SSLContext, and setting an invalid one. I'm not testing the actual functionality of the SSLContext, etc.

Author: Alex Rankin <davelister@gmail.com>
Author: Alex Rankin <alex.rankin@mastercard.com>

Reviewers: andor@apache.org

Closes #728 from arankin-irl/ZOOKEEPER-3160 and squashes the following commits:

a20c62feb [Alex Rankin] Merge branch 'master' into ZOOKEEPER-3160
5a9b8fcb4 [Alex Rankin] Merge pull request #7 from apache/master
3c3dfdd70 [Alex Rankin] Re-ordering imports.
69e0b6c93 [Alex Rankin] Updating custom SSLContext supplier with review comments
874529ba0 [Alex Rankin] Using supplier interface instead of custom interface, and renaming property
ec272607d [Alex Rankin] Merge branch 'master' into ZOOKEEPER-3160
75a010e34 [Alex Rankin] Merge pull request #6 from apache/master
838f61c1a [Alex Rankin] Merge branch 'master' into ZOOKEEPER-3160
f85d7e5cb [Alex Rankin] Merge pull request #5 from apache/master
31d8dd5a4 [Alex Rankin] Extracting SSLContext creation from config to new method.
400839a60 [Alex Rankin] Adding ability to specify custom SSLContext for client
7ae74851b [Alex Rankin] Merge pull request #4 from apache/master

3 weeks agoZOOKEEPER-3176: Quorum TLS - add SSL config options
Ilya Maykov [Thu, 24 Jan 2019 10:53:00 +0000 (11:53 +0100)] 
ZOOKEEPER-3176: Quorum TLS - add SSL config options

Add  SSL config options for enabled protocols and client auth mode.
Improve handling of SSL config options for protocols and cipher suites - previously these came from system properties, now they can come from ZKConfig which means they are easier to isolate in tests, and now we don't need to parse system properties every time we create a secure socket.

## Added more options for ssl settings to X509Util and encapsulate them better
- previously, some SSL settings came from a `ZKConfig` and others came from global `System.getProperties()`. This made it hard to isolate certain settings in tests.
- now all SSL-related settings come from the `ZKConfig` object used to create the SSL context
- new settings added:
- `zookeeper.ssl(.quorum).enabledProtocols` - list of enabled protocols. If not set, defaults to a single-entry list with the value of `zookeeper.ssl(.quorum).protocol`.
- `zookeeper.ssl(.quorum).clientAuth` - can be "NONE", "WANT", or "NEED". This controls whether the server doesn't want / allows / requires the client to present an X509 certificate.
- `zookeeper.ssl(.quorum).handshakeDetectionTimeoutMillis` - timeout for the first read of 5 bytes to detect the transport mode (TLS or plaintext) of a client connection made to a `UnifiedServerSocket`

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #681 from ivmaykov/ZOOKEEPER-3176

3 weeks agoZOOKEEPER-3242: Add server side connecting throttling
Jie Huang [Wed, 23 Jan 2019 13:00:13 +0000 (14:00 +0100)] 
ZOOKEEPER-3242: Add server side connecting throttling

Author: Jie Huang <jiehuang@fb.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #769 from jhuan31/ZOOKEEPER-3242 and squashes the following commits:

c3ec81f4e [Jie Huang] refactoring
86cad39c4 [Jie Huang] Use a mock random number generator to make the unit test flaky-proof
a278504d4 [Jie Huang] Add unit tests for server-side connection throttling
fd966502b [Jie Huang] update doc for server-side connection throttling
2f1ed0b87 [Jie Huang] Fix FindBugs Warnings
a48b0fcb1 [Jie Huang] ZOOKEEPER-3242: Add server side connecting throttling

3 weeks agoZOOKEEPER-3223: Configure spotbugs - part 2
Enrico Olivelli [Tue, 22 Jan 2019 05:43:44 +0000 (06:43 +0100)] 
ZOOKEEPER-3223: Configure spotbugs - part 2

- move to spotbugs 3.1.9
- disable spotbugs on contrib package
- fix spotbugs warnings on recipes
- add commons-lang 2.6 dependency in order to fix build

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: andor@apache.org

Closes #779 from eolivelli/fix/ZOOKEEPER-3223-master-part2

4 weeks agoZOOKEEPER-3232: make the log of notification about LE more readable
maoling [Fri, 18 Jan 2019 02:49:12 +0000 (10:49 +0800)] 
ZOOKEEPER-3232: make the log of notification about LE more readable

- The first PR of the NEW YEAR:2019.good luck to me(:D).
- More details in [ZOOKEEPER-3232](https://issues.apache.org/jira/browse/ZOOKEEPER-3232)

Author: maoling <maoling199210191@sina.com>

Reviewers: fangmin@apache.org, evolivelli@apche.org

Closes #749 from maoling/ZOOKEEPER-3232

4 weeks agoZOOKEEPER-3218: Add min notification interval property for fast leader election
Brian Nixon [Fri, 18 Jan 2019 02:42:12 +0000 (10:42 +0800)] 
ZOOKEEPER-3218: Add min notification interval property for fast leader election

…to the new leader is too long,then session expired

Author: Brian Nixon <nixon@fb.com>

Reviewers: fangmin@apache.org, eolivelli@apache.org

Closes #747 from enixon/noti-inter

4 weeks agoZOOKEEPER-3209: Fix compilation error
Dinesh Appavoo [Wed, 16 Jan 2019 22:23:04 +0000 (15:23 -0700)] 
ZOOKEEPER-3209: Fix compilation error

Author: Dinesh Appavoo <dappavoo@twitter.com>

Reviewers: andor@apache.org

Closes #778 from anmolnar/ZOOKEEPER-3209_buildfix

4 weeks agoZOOKEEPER-3209: New `getEphemerals` api to get all the ephemeral nodes created by...
Dinesh Appavoo [Wed, 16 Jan 2019 13:21:28 +0000 (06:21 -0700)] 
ZOOKEEPER-3209: New `getEphemerals` api to get all the ephemeral nodes created by the session

See https://issues.apache.org/jira/browse/ZOOKEEPER-3209 for details about the API.

New API `getEphemerals()` to get all the ephemeral nodes created by the session by providing the prefix path.

* Get the prefix path as a input parameter and return a list of string (ephemeral nodes)
* If the prefix path is `/` or empty return all the ephemeral nodes created by the session
* Provide synchronous and asynchronous API's with same functionality

Author: Dinesh Appavoo <dappavoo@twitter.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #735 from dineshappavoo/ZOOKEEPER-3209

4 weeks agoZOOKEEPER-3122: MAVEN MIGRATION - - remove contrib build from default build profile
Norbert Kalmar [Mon, 14 Jan 2019 23:42:39 +0000 (16:42 -0700)] 
ZOOKEEPER-3122: MAVEN MIGRATION - - remove contrib build from default build profile

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: andor@apache.org

Closes #774 from nkalmar/ZK-3122

4 weeks agoZOOKEEPER-2284: LogFormatter and SnapshotFormatter does not handle FileNotFoundExcept...
maoling [Mon, 14 Jan 2019 18:43:00 +0000 (11:43 -0700)] 
ZOOKEEPER-2284: LogFormatter and SnapshotFormatter does not handle FileNotFoundException gracefully

- More details in [ZOOKEEPER-2284](https://issues.apache.org/jira/browse/ZOOKEEPER-2284) .Thanks [arshad.mohammad](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=arshad.mohammad) for original work!

Author: maoling <maoling199210191@sina.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #630 from maoling/ZOOKEEPER-2284 and squashes the following commits:

393cccdc5 [maoling] git rebase the code again
92c855f30 [maoling] rebase the code
5042a65bc [maoling] ZOOKEEPER-2284:LogFormatter and SnapshotFormatter does not handle FileNotFoundException gracefully

4 weeks agoZOOKEEPER-3195: TLS - disable client-initiated renegotiation
Ilya Maykov [Mon, 14 Jan 2019 18:40:19 +0000 (11:40 -0700)] 
ZOOKEEPER-3195: TLS - disable client-initiated renegotiation

Summary: client-initiated renegotiation is insecure and is vulnerable to MITM attacks.
Unfortunately, the feature is enabled in Java by default. This disables it.
See https://bugs.openjdk.java.net/browse/JDK-7188658 and
https://www.oracle.com/technetwork/java/javase/documentation/tlsreadme-141115.html

Test Plan: manually tested by running a secure ZK server and probing the listening port
with python's sslyze tool (using `sslyze --reneg ...`). Tested on Java 8, 9, 10, and 11.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #710 from ivmaykov/ZOOKEEPER-3195

4 weeks agoZOOKEEPER-3180: Add response cache to improve the throughput of read …
Brian Nixon [Mon, 14 Jan 2019 18:38:53 +0000 (11:38 -0700)] 
ZOOKEEPER-3180: Add response cache to improve the throughput of read …

…heavy traffic

Introduces a ResponseCache that interacts with ServerCnxn to cache the serialized response for getData requests.

Author: Brian Nixon <nixon@fb.com>

Reviewers: hanm@apache.org, fangmin@apache.org, andor@apache.org

Closes #684 from enixon/response-cache and squashes the following commits:

c264b88f8 [Brian Nixon] fix the types in ResponseCacheTest::checkCacheStatus to match the recent change
5e36b396a [Brian Nixon] add documentation
e413de1a6 [Brian Nixon] remove JMX use from ResponseCacheTest
c7a3f8eb0 [Brian Nixon] ZOOKEEPER-3180: Add response cache to improve the throughput of read heavy traffic

4 weeks agoZOOKEEPER-3202: Add timing margin to improve reliability of testClientServerSSL()
Michael Edwards [Mon, 14 Jan 2019 14:36:15 +0000 (07:36 -0700)] 
ZOOKEEPER-3202: Add timing margin to improve reliability of testClientServerSSL()

Allowing just 5 seconds for 3 quorum peers to start and elect a leader is a bit tight, at least when running 4 test processes in parallel inside a (Linux) Docker container on a (non-Linux) laptop.  Add up to 10 seconds of extra margin.

Author: Michael Edwards <Michael Edwards>

Reviewers: andor@apache.org

Closes #723 from mkedwards/ZOOKEEPER-3202

5 weeks agoZOOKEEPER-3235: Enable secure processing and disallow DTDs in the SAXParserFactory
Colm O hEigeartaigh [Wed, 9 Jan 2019 14:09:14 +0000 (15:09 +0100)] 
ZOOKEEPER-3235: Enable secure processing and disallow DTDs in the SAXParserFactory

It's good security practice to set the secure processing feature on SAXParserFactory and to disallow Doctypes if they aren't needed.

Author: Colm O hEigeartaigh <coheigea@apache.org>

Reviewers: andor@apache.org

Closes #716 from coheigea/sax_secureproc

5 weeks agoZOOKEEPER-3210: typo in zookeeperInternals doc
Stanislav Knot [Tue, 8 Jan 2019 16:21:00 +0000 (17:21 +0100)] 
ZOOKEEPER-3210: typo in zookeeperInternals doc

Author: Stanislav Knot <sknot@redhat.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #732 from stanlyDoge/patch-1

5 weeks agoZOOKEEPER-3197: Improve documentation in ZooKeeperServer.superSecret
Colm O hEigeartaigh [Mon, 7 Jan 2019 14:34:02 +0000 (15:34 +0100)] 
ZOOKEEPER-3197: Improve documentation in ZooKeeperServer.superSecret

Author: Colm O hEigeartaigh <coheigea@apache.org>

Reviewers: andor@apache.org

Closes #752 from coheigea/ZOOKEEPER-3197

5 weeks agoZOOKEEPER-3203: Tracking the number of non voting followers in ZK
Fangmin Lyu [Mon, 7 Jan 2019 13:55:43 +0000 (14:55 +0100)] 
ZOOKEEPER-3203: Tracking the number of non voting followers in ZK

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: andor@apache.org

Closes #722 from lvfangmin/ZOOKEEPER-3203

5 weeks agoZOOKEEPER-2641: AvgRequestLatency metric improves to be more accurate
maoling [Mon, 7 Jan 2019 13:39:13 +0000 (14:39 +0100)] 
ZOOKEEPER-2641: AvgRequestLatency metric improves to be more accurate

- some original review historys were included [here ](https://github.com/apache/zookeeper/pull/629)
- more details in [ZOOKEEPER-2641](https://issues.apache.org/jira/browse/ZOOKEEPER-2641)

Author: maoling <maoling199210191@sina.com>

Reviewers: andor@apache.org

Closes #748 from maoling/ZOOKEEPER-2641 and squashes the following commits:

e0d4fc890 [maoling] fix the flaky test in the FourLetterWordsTest.testValidateStatOutput
1739dbf1c [maoling] fix the flaky test in the CommandsTest.testMonitor
01af4002e [maoling] ZOOKEEPER-2641:AvgRequestLatency metric improves to be more accurate

5 weeks agoZOOKEEPER-3223: Configure Spotbugs
Enrico Olivelli [Mon, 7 Jan 2019 13:24:07 +0000 (14:24 +0100)] 
ZOOKEEPER-3223: Configure Spotbugs

- add spotbugs configuration (default)
- make build pass spotbugs

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: andor@apache.org

Closes #742 from eolivelli/fix/ZOOKEEPER-3223-spotbugs and squashes the following commits:

a43cecf41 [Enrico Olivelli] Fix false positive
c00d296ad [Enrico Olivelli] Add Suppression for false positive
35c8a4dde [Enrico Olivelli] fix tests
1ae629bcd [Enrico Olivelli] revert file
c0bb9d903 [Enrico Olivelli] Add spotbugs annotations to ant based build
dabe4fafc [Enrico Olivelli] [ZOOKEEPER-3223] Configure Spotbugs - add spotbugs configuration - make build pass spotbugs

6 weeks agoZOOKEEPER-3217: owasp job flagging slf4j on trunk
Enrico Olivelli - Diennea [Thu, 3 Jan 2019 15:32:46 +0000 (16:32 +0100)] 
ZOOKEEPER-3217: owasp job flagging slf4j on trunk

Disable OWASP checks about slf4j.
We are not using EventData, so ZooKeeper is not subject to https://nvd.nist.gov/vuln/detail/CVE-2018-8088

Author: Enrico Olivelli - Diennea <eolivelli@apache.org>
Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: phunt@apache.org, andor@apache.org

Closes #736 from eolivelli/fix/ZOOKEEPER-3217-owasp and squashes the following commits:

7dd4473a1 [Enrico Olivelli] Add missing license header
dc9bd75cd [Enrico Olivelli - Diennea] ZOOKEEPER-3217 owasp job flagging slf4j on trunk

6 weeks agoZOOKEEPER-3222: Flaky: multiple intermittent segfaults in C++ tests
Andor Molnar [Thu, 3 Jan 2019 14:57:39 +0000 (15:57 +0100)] 
ZOOKEEPER-3222: Flaky: multiple intermittent segfaults in C++ tests

1. Removed the failing test case: client cannot be validated after closing.
2. Explicitly close the client before creating new.

Author: Andor Molnar <andor@cloudera.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #740 from anmolnar/ZOOKEEPER-3222

6 weeks agoZOOKEEPER-3233: Run github pre-commit hook tests on 4 threads
Andor Molnar [Thu, 3 Jan 2019 10:23:36 +0000 (11:23 +0100)] 
ZOOKEEPER-3233: Run github pre-commit hook tests on 4 threads

1. Changed number of threads: 8 -> 4
2. Turned off test.output: yes -> no

Author: Andor Molnar <andor@apache.org>

Reviewers: andor@apache.org

Closes #750 from anmolnar/ZOOKEEPER-3233

6 weeks agoZOOKEEPER-3171: MAVEN MIGRATION - - Add recipes and contrib maven build
Norbert Kalmar [Wed, 2 Jan 2019 14:32:18 +0000 (15:32 +0100)] 
ZOOKEEPER-3171: MAVEN MIGRATION - - Add recipes and contrib maven build

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: andor@apache.org

Closes #745 from nkalmar/ZOOKEEPER-3171r and squashes the following commits:

deb5ed337 [Norbert Kalmar] ZOOKEEPER-3171 - fix releaseaudit excludes
d70503e76 [Norbert Kalmar] ZOOKEEPER-3171 - Add recipes and contrib maven build

6 weeks agoZOOKEEPER-3226: MAVEN MIGRATION - - add profile for C build
Norbert Kalmar [Wed, 2 Jan 2019 14:27:05 +0000 (15:27 +0100)] 
ZOOKEEPER-3226: MAVEN MIGRATION - - add profile for C build

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: andor@apache.org

Closes #741 from nkalmar/ZOOKEEPER-3226

6 weeks agoZOOKEEPER-3205: Add test cases for jute
Karthik K [Wed, 2 Jan 2019 14:10:02 +0000 (22:10 +0800)] 
ZOOKEEPER-3205: Add test cases for jute

Adding some test cases for o.a.jute BinaryInputArchive .  Issue ZOOKEEPER-3205 contains the patch as well.

Author: Karthik K <karthiknetworklink@gmail.com>

Reviewers: fangmin@apache.org, eolivelli@apache.org

Closes #726 from akkumar/jutetest

6 weeks agoZOOKEEPER-3228: [TLS] Fix key usage extension in test certs
Ilya Maykov [Wed, 2 Jan 2019 12:41:06 +0000 (13:41 +0100)] 
ZOOKEEPER-3228: [TLS] Fix key usage extension in test certs

Key usage extension is wrong in test certs created by X509TestHelpers. This works with Java SSL stack because it allows sloppy certs, but breaks with Netty's OpenSSL stack. My Netty OpenSSL code is not ready for upstream yet, but fixing the test cert extensions is a prerequisite and can go in separately.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #743 from ivmaykov/ZOOKEEPER-3228

7 weeks agoZOOKEEPER-3230: Add Apache NetBeans Maven project files to .gitignore
Enrico Olivelli [Sun, 23 Dec 2018 01:57:36 +0000 (17:57 -0800)] 
ZOOKEEPER-3230: Add Apache NetBeans Maven project files to .gitignore

Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: phunt@apache.org

Closes #746 from eolivelli/ZOOKEEPER-3230-netbeans-maven-gitignore

Change-Id: Ifd31386069a867293d21825239a38c4f8c38b3f1

8 weeks agoZOOKEEPER-3125: Only patching the pzxid when it's larger than the current pzxid
Fangmin Lyu [Thu, 20 Dec 2018 14:17:52 +0000 (22:17 +0800)] 
ZOOKEEPER-3125: Only patching the pzxid when it's larger than the current pzxid

This previous fix in #605 has a corner case which might revert the pzxid, it's being fixed when port to 3.5 in #647, update on master as well.

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: eolivelli@gmail.com

Closes #701 from lvfangmin/ZOOKEEPER-3125-Update

8 weeks agoZOOKEEPER-3216: Make init/sync limit tunable via JMX
Jie Huang [Thu, 20 Dec 2018 14:13:46 +0000 (22:13 +0800)] 
ZOOKEEPER-3216: Make init/sync limit tunable via JMX

Author: Jie Huang <jiehuang@fb.com>

Reviewers: fangmin@apache.org, eolivelli@gmail.com

Closes #738 from jhuan31/ZOOKEEPER-3216

8 weeks agoZOOKEEPER-3219: Fix flaky FileChangeWatcherTest
Ilya Maykov [Thu, 20 Dec 2018 14:07:14 +0000 (22:07 +0800)] 
ZOOKEEPER-3219: Fix flaky FileChangeWatcherTest

Made some changes to handle the random ENTRY_CREATE events that occasionally fire even though the watcher is created after the file is already written to disk. Should make the test more stable.

Author: Ilya Maykov <ilyam@fb.com>

Closes #739 from ivmaykov/ZOOKEEPER-3219

8 weeks agoZOOKEEPER-3029: add pom.xml for jute, client and server
Norbert Kalmar [Thu, 20 Dec 2018 06:24:17 +0000 (07:24 +0100)] 
ZOOKEEPER-3029: add pom.xml for jute, client and server

Work In Progress
Creating the maven build for zookeeper-server, zookeeper-jute and zookeeper-client (which only contains C client right now, and it hasn't been implemented yet - maven is not calling make or autoconf)

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: andor@apache.org

Closes #708 from nkalmar/ZOOKEEPER-3029r and squashes the following commits:

4b1354f41 [Norbert Kalmar] ZOOKEEPER-3029 - add java clover coverage
9c4591ce5 [Norbert Kalmar] ZOOKEEPER-3029 - fix pom issues and clover classpath
5b9350abd [Norbert Kalmar] ZOOKEEPER-3029 - fix C maven test classpath issues
69a2c51b6 [Norbert Kalmar] ZOOKEEPER-3029 - change git-wip-us git to gitbox
daf273a7e [Norbert Kalmar] ZOOKEEPER-3029 - remove build.xml from c-client, use maven
e328cb812 [Norbert Kalmar] ZOOKEEPER-3029 - fix cppunit tests
5133abe46 [Norbert Kalmar] ZOOKEEPER-3029 - fix portAssigment bug with maven
eb7b4abfb [Norbert Kalmar] ZOOKEEPER-3029 - fix jute dependency import
d786b90a2 [Norbert Kalmar] ZOOKEEPER-3029 - Build C library and fix tests
438cd43de [Norbert Kalmar] ZOOKEEPER-3029 - add pom.xml for jute, client and server

2 months agoZOOKEEPER-3174: Quorum TLS - support reloading trust/key store
Ilya Maykov [Sat, 15 Dec 2018 06:34:54 +0000 (07:34 +0100)] 
ZOOKEEPER-3174: Quorum TLS - support reloading trust/key store

Allow reloading SSL trust stores and key stores from disk when the files on disk change.

## Added support for reloading key/trust stores when the file on disk changes
- new property `sslQuorumReloadCertFiles` which controls the behavior for reloading the key and trust store files for `QuorumX509Util`. Reloading of key and trust store for `ClientX509Util` is not in this PR but could be added easily
- this allows a ZK server to keep running on a machine that uses short-lived certs that refresh frequently without having to restart the ZK process.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #680 from ivmaykov/ZOOKEEPER-3174

2 months agoZOOKEEPER-3208 ZOOKEEPER-3032: Remove the SSLTest.java.orig introduced in
Fangmin Lyu [Tue, 11 Dec 2018 13:06:45 +0000 (14:06 +0100)] 
ZOOKEEPER-3208 ZOOKEEPER-3032: Remove the SSLTest.java.orig introduced in

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: andor@apache.org

Closes #731 from lvfangmin/ZOOKEEPER-3208

2 months agoZOOKEEPER-3207: Removing the unexpected WatchManager.java introduced by mistake durin...
Fangmin Lyu [Tue, 11 Dec 2018 13:03:37 +0000 (14:03 +0100)] 
ZOOKEEPER-3207: Removing the unexpected WatchManager.java introduced by mistake during maven migration

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: andor@apache.org

Closes #729 from lvfangmin/ZOOKEEPER-3207

2 months agoZOOKEEPER-1636: cleanup completion list of a failed multi request
Michael Edwards [Mon, 10 Dec 2018 14:28:57 +0000 (15:28 +0100)] 
ZOOKEEPER-1636: cleanup completion list of a failed multi request

(from Thawan Kooburat)

Author: Michael Edwards <Michael Edwards>

Reviewers: andor@apache.org

Closes #717 from mkedwards/ZOOKEEPER-1636-for-master

2 months agoZOOKEEPER-3140: Allow Followers to host Observers
Brian Nixon [Sun, 9 Dec 2018 02:16:58 +0000 (18:16 -0800)] 
ZOOKEEPER-3140: Allow Followers to host Observers

Creates a new abstraction, LearnerMaster, to represent the portions of the Leader logic that are used in LearnerHandler. Leader implements LearnerMaster and a new class ObserverMaster implements LearnerMaster. Followers have the option of instantiating a ObserverMaster thread when they assume their role and so support Learner traffic.

A new parameter 'observerMasterPort' is used to control which Follower instances host Observers.

Author: Brian Nixon <nixon@fb.com>

Reviewers: fangmin@apache.org, hanm@apache.org, eolivelli@gmail.com

Closes #628 from enixon/learner-master

2 months agoZOOKEEPER-2778: QuorumPeer: address potential reconfiguration deadlocks
Michael Edwards [Fri, 7 Dec 2018 11:41:50 +0000 (12:41 +0100)] 
ZOOKEEPER-2778: QuorumPeer: address potential reconfiguration deadlocks

* QuorumPeer: encapsulate quorum/election/client addresses in an AddressTuple held through an AtomicReference
* QuorumPeer/QuorumCnxManager: address deadlock and visibility issues
* QuorumPeer: add fast path for already-non-null quorum/election address
* QuorumPeer: fix access to newly private data members from ReconfigTest
* LeaderBeanTest: set up mock QuorumVerifier so that addresses get set
* QuorumPeer: warn when clobbering existing election algorithm
* QuorumPeer: halt old QCM when clobbering existing election algorithm

Author: Michael Edwards <medwards@bitpusher.com>

Reviewers: andor@apache.org

Closes #719 from mkedwards/ZOOKEEPER-2778-for-master

2 months agoZOOKEEPER-1818: Correctly handle potential inconsistent zxid/electionEpoch and peerEp...
Fangmin Lyu [Thu, 6 Dec 2018 09:56:21 +0000 (10:56 +0100)] 
ZOOKEEPER-1818: Correctly handle potential inconsistent zxid/electionEpoch and peerEpoch during leader election

This is similar to the 3.4 implementation in Jira ZOOKEEPER-1817, main differences with that:

1. removed bcVote, in Vote.equals it will skip compare peerEpoch when one of the version is 0x0.
2. added detailed scenarios which we tried to solve with peerEpoch update and the change in Vote.equals.
3. removed ooePredicate with inlined one, since master code is tracking voteSet..
4. improved the tests to make it cleaner.

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: hanm@apache.org, andor@apache.org

Closes #703 from lvfangmin/ZOOKEEPER-1818 and squashes the following commits:

022fcbb78 [Fangmin Lyu] update the comment in the test
b51e124c4 [Fangmin Lyu] update comment about the JIRA references
ccccac2aa [Fangmin Lyu] Correctly handle potential inconsitent zxid/electionEpoch and peerEpoch during leader election

2 months agoZOOKEEPER-3183: Interrupting the WatcherCleaner thread during shutdown
vtumati [Wed, 28 Nov 2018 22:43:41 +0000 (14:43 -0800)] 
ZOOKEEPER-3183: Interrupting the WatcherCleaner thread during shutdown

…are waiting list to add watchers during the shutdown  and avoid adding the dead watchers when shut down is initiated

Author: vtumati <vtumati@paypal.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #689 from tumativ/ZOOKEEPER-3183

2 months agoZOOKEEPER-3194: Quorum TLS - fix copy/paste bug in ZKTrustManager
Ilya Maykov [Tue, 27 Nov 2018 20:04:31 +0000 (21:04 +0100)] 
ZOOKEEPER-3194: Quorum TLS - fix copy/paste bug in ZKTrustManager

Fix an obvious copy/paste bug. Tested by making sure ZKTrustManagerTest still passes.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #709 from ivmaykov/ZOOKEEPER-3194

2 months agoZOOKEEPER-3172: Quorum TLS - fix port unification to allow rolling upgrades
Ilya Maykov [Tue, 27 Nov 2018 09:02:24 +0000 (10:02 +0100)] 
ZOOKEEPER-3172: Quorum TLS - fix port unification to allow rolling upgrades

Fix numerous problems with UnifiedServerSocket, such as hanging the accept() thread when the client doesn't send any data or crashing if less than 5 bytes are read from the socket in the initial read.

Re-enable the "portUnification" config option.

## Fixed networking issues/bugs in UnifiedServerSocket

- don't crash the `accept()` thread if the client closes the connection without sending any data
- don't corrupt the connection if the client sends fewer than 5 bytes for the initial read
- delay the detection of TLS vs. plaintext mode until a socket stream is read from or written to. This prevents the `accept()` thread from getting blocked on a `read()` operation from the newly connected socket.
- prepending 5 bytes to `PrependableSocket` and then trying to read >5 bytes would only return the first 5 bytes, even if more bytes were available. This is fixed.

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #679 from ivmaykov/ZOOKEEPER-3172

2 months agoZOOKEEPER-2822: Wrong `ObjectName` about `MBeanServer` in JMX module
asdf2014 [Tue, 27 Nov 2018 08:57:53 +0000 (09:57 +0100)] 
ZOOKEEPER-2822: Wrong `ObjectName` about `MBeanServer` in JMX module

The wrong `ObjectName` about `MBeanServer` in JMX module, should `log4j:hierarchy=default` rather than `log4j:hiearchy=default`.

Author: asdf2014 <benedictjin2016@gmail.com>

Reviewers: andor@apache.org

Closes #294 from asdf2014/ZOOKEEPER-2822 and squashes the following commits:

294cf53ab [asdf2014] Using `System.getProperty` instead of `System.getenv` & doc this change
ed756a9b8 [asdf2014] Add `zookeeper.jmx.log4j.mbean`
82da83a71 [asdf2014] ZOOKEEPER-2822: Wrong `ObjectName` about `MBeanServer` in JMX module

2 months agoZOOKEEPER-3193: Flaky: org.apache.zookeeper.test.SaslAuthFailNotifyTest
Andor Molnar [Tue, 27 Nov 2018 08:55:53 +0000 (09:55 +0100)] 
ZOOKEEPER-3193: Flaky: org.apache.zookeeper.test.SaslAuthFailNotifyTest

1. Refactor SASL auth tests to use single file,
2. Use CountDownLatch to sync with watcher

More context: https://issues.apache.org/jira/browse/ZOOKEEPER-3193

Author: Andor Molnar <andor@apache.org>

Reviewers: andor@apache.org

Closes #706 from anmolnar/ZOOKEEPER-3193

2 months agoZOOKEEPER-1441: JAVA 11 - Some test cases are failing because Port bind issue.
Andor Molnar [Fri, 23 Nov 2018 10:51:32 +0000 (11:51 +0100)] 
ZOOKEEPER-1441: JAVA 11 - Some test cases are failing because Port bind issue.

Fixes the Java 11 build issue.

**Issue**

`NIOServerCnxnFactory` doesn't properly close the socket when the shutdown() is called before the factory has even started. This is mostly the case in tests which use `QuorumUtil` that creates multiple QuorumPeers when instantiated without starting them and when `startAll()` gets called it shuts down the previous ones.

**Reason**

`Selectors` which have been registered with the socket must be closed in order to properly release the socket. `NIOServerCnxnFactory` registers selectors on instantiation, but only releases them in the thread run() method. So, if factory doesn't get started, it won't release the registered selectors.

This wasn't the issue before Java 11 and probably caused by:
https://www.oracle.com/technetwork/java/javase/11-relnote-issues-5012449.html#JDK-8198562

Also this is not an issue when ZooKeeper is used as a separate process (not embedded), because on shutdown the entire JVM stops anyway.

**Resolution**

I decided to try fixing the issue in the connection factory instead of fixing the tests only, because originally it's a bug in the way factory works. Resolution is to open selectors in lazy way: only when accept and selector thread starts, so they don't need to be released if the thread was not even started.

Author: Andor Molnar <andor@apache.org>

Reviewers: hanm@apache.org

Closes #700 from anmolnar/ZOOKEEPER-1441

2 months agoZOOKEEPER-3152: Port ZK netty stack to netty4
Ilya Maykov [Thu, 22 Nov 2018 16:56:01 +0000 (17:56 +0100)] 
ZOOKEEPER-3152: Port ZK netty stack to netty4

Summary: Ported the client connection netty stack from netty3 to netty4. This includes both the server side (NettyServerCnxn and friends) and the client side (ClientCnxnSocketNetty).

Test Plan: Modified `FourLetterWordsTest` and `NettyServerCnxnTest`, plus manual testing on a regional ensemble.

FB Reviewers: nixon

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #669 from ivmaykov/ZOOKEEPER-3152

2 months agoZOOKEEPER-3177: Revert globalOutstandingLimit refactoring changes
Andor Molnar [Wed, 21 Nov 2018 16:56:08 +0000 (08:56 -0800)] 
ZOOKEEPER-3177: Revert globalOutstandingLimit refactoring changes

Hopefully this will fix the findBugs issue on master in the right way.
lvfangmin hanm Please validate.

Author: Andor Molnar <andor@apache.org>

Reviewers: Michael Han <hanm@apache.org>, Enrico Olivelli <eolivelli@gmail.com>

Closes #711 from anmolnar/ZOOKEEPER-3177

2 months agoZOOKEEPER-3190: Spell check on the Zookeeper server files
dappavoo [Sat, 17 Nov 2018 17:37:08 +0000 (09:37 -0800)] 
ZOOKEEPER-3190: Spell check on the Zookeeper server files

This pull request is to do spell check on the zookeeper server files [ zookeeper/zookeeper-server/src/main/java/org/apache/zookeeper/server ] for a newbie to understand the process.

Author: dappavoo <dappavoo@twitter.com>

Reviewers: Allan Lyu <fangmin@apache.org>, Enrico Olivelli <eolivelli@gmail.com>, Michael Han <hanm@apache.org>

Closes #702 from dineshappavoo/ZOOKEEPER-3190

2 months agoZOOKEEPER-3177: Refactor request throttle logic in NIO and Netty to keep the same...
Fangmin Lyu [Sat, 17 Nov 2018 17:33:40 +0000 (09:33 -0800)] 
ZOOKEEPER-3177: Refactor request throttle logic in NIO and Netty to keep the same behavior and make the code easier to maintain

Author: Fangmin Lyu <allenlyu@fb.com>

Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Venkateswarlu Tumati <tumativ@gmail.com>, Michael Han <hanm@apache.org>

Closes #673 from lvfangmin/ZOOKEEPER-3177

3 months agoZOOKEEPER-3071: Add a config parameter to control transaction log size
Suyog Mapara [Mon, 12 Nov 2018 21:36:32 +0000 (13:36 -0800)] 
ZOOKEEPER-3071: Add a config parameter to control transaction log size

Author: Suyog Mapara <suyogm@fb.com>
Author: Suyog Mapara <suyogm@devvm30625.prn1.facebook.com>

Reviewers: breed@apache.org, andor@apache.org

Closes #567 from suyogmapara/ZOOKEEPER-3071 and squashes the following commits:

0a2899994 [Suyog Mapara] Addressing comments
9d5765181 [Suyog Mapara] Update documentation per comments.
5201329bc [Suyog Mapara] Updating documentation
6d2b72058 [Suyog Mapara] Addressing comments
9386e2b6c [Suyog Mapara] ZOOKEEPER-3071: Updating comment to include more details about the feature
5a28efd72 [Suyog Mapara] ZOOKEEPER-3071: Addressing comments and fixing incorrect merge.
1aa12f9d3 [Suyog Mapara] ZOOKEEPER-3071: Add a config parameter to control transaction log size

3 months agoZOOKEEPER-3162: Broken lock semantics in C client lock-recipe.
Andrea Reale [Wed, 7 Nov 2018 23:54:43 +0000 (15:54 -0800)] 
ZOOKEEPER-3162: Broken lock semantics in C client lock-recipe.

This PR fixes a few issues with the C client lock-recipe, as documented in more detailed in [ZOOKEEPER-3162](https://issues.apache.org/jira/browse/ZOOKEEPER-3162) on JIRA.

Details are also provided in the individual commits, but in short:
- Fix a bug in the choice of the predecessor node while trying to acquire the lock
- Fix a possible deadlock in zkr_lock_operation
- Fix the return value of zkr_lock_lock to abide to the prescribed semantics.

Author: Andrea Reale <realean2@ie.ibm.com>

Reviewers: andor@apache.org

Closes #662 from andreareale/ZOOKEEPER-3162 and squashes the following commits:

09f7ff4ed [Andrea Reale] Fixes deadlock in zoo_lock_operation
670d25a8e [Andrea Reale] Fix return semantics of zkr_lock_lock
2a1d66c4b [Andrea Reale] Bugfix on zookeeper-recipes-lock C implementation
a9b6a1a09 [Andrea Reale] Fix wrong include path for C recipes

3 months agoZOOKEEPER-3173: Quorum TLS - support PEM trust/key stores
Ilya Maykov [Wed, 7 Nov 2018 01:29:49 +0000 (17:29 -0800)] 
ZOOKEEPER-3173: Quorum TLS - support PEM trust/key stores

Add support for loading key and trust stores from PEM files.

Unfortunately, this PR includes 2 JIRAs, because it was quite difficult
to untangle the two features as they were developed at the same time
originally:

- ZOOKEEPER-3173: Quorum TLS - support PEM trust/key stores
- ZOOKEEPER-3175: Quorum TLS - test improvements

## Added support for PEM formatted key stores and trust stores
- key store and trust store files can now be in PEM format as well as JKS.
- Added config properties to tell ZK what type of trust/key store to load:
- `zookeeper.ssl.keyStore.type` and `zookeeper.ssl.trustStore.type` for ClientX509Util
- `zookeeper.ssl.quorum.keyStore.type` and `zookeeper.ssl.quorum.trustStore.type` for QuorumX509Util
- store type properties could have the values "JKS", "PEM", or not set
- leaving the type properties unset will cause auto-detection of the store type based on the file extension (".jks" or ".pem")

## Added test utilities for easily creating X509 certs and using them in unit tests
- added new class `X509TestContext` and its friend, `X509TestHelpers`
- rewrote some existing unit tests to use these classes, and added new tests that use them
- some existing tests (i.e. `QuorumSSLTest`) should probably be ported to use this as well, haven't got around to it yet

Author: Ilya Maykov <ilyam@fb.com>

Reviewers: andor@apache.org

Closes #678 from ivmaykov/ZOOKEEPER-3173

3 months agoZOOKEEPER-3155: Remove Forrest XMLs and their build process from the …
Tamas Penzes [Tue, 6 Nov 2018 17:50:15 +0000 (09:50 -0800)] 
ZOOKEEPER-3155: Remove Forrest XMLs and their build process from the …

…project

In this commit I've removed the forrest XML files and their result from the repository.
I've also removed the process to generate HTML and PDF files from the forrest files, since it's not needed anymore.

It also effects the test-github-pr.sh and test-patch.sh, since we do have less parameters for them (FORREST_HOME).

Change-Id: I30ecdb181f19eed05d86838b12c75e0c03e33710

Author: Tamas Penzes <tamaas@cloudera.com>

Reviewers: andor@apache.org

Closes #671 from tamaashu/ZOOKEEPER-3155

3 months agoZOOKEEPER-3156: Add in option to canonicalize host name
Robert Evans [Mon, 5 Nov 2018 18:40:55 +0000 (10:40 -0800)] 
ZOOKEEPER-3156: Add in option to canonicalize host name

This is the master and 3.5 version of #648.  It should apply cleanly to both lines, but if you want a separate pull request for each I am happy to do it.

Author: Robert Evans <evans@yahoo-inc.com>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #652 from revans2/ZOOKEEPER-3156

3 months agoZOOKEEPER-2807: Fix flaky test org.apache.zookeeper.test.WatchEventWhenAutoResetTest...
Andor Molnar [Mon, 5 Nov 2018 07:45:40 +0000 (23:45 -0800)] 
ZOOKEEPER-2807: Fix flaky test org.apache.zookeeper.test.WatchEventWhenAutoResetTest.testNodeDataChanged

Mark the test as ignored.
Please see https://issues.apache.org/jira/browse/ZOOKEEPER-3182 for more details

Author: Andor Molnar <andor@apache.org>

Reviewers: Fangmin Lyu <fangmin@apache.org>

Closes #682 from anmolnar/ZOOKEEPER-2807

3 months agoZOOKEEPER-3163: Use session map in the Netty to improve close session performance
Fangmin Lyu [Wed, 24 Oct 2018 02:03:01 +0000 (19:03 -0700)] 
ZOOKEEPER-3163: Use session map in the Netty to improve close session performance

This is a refactor to make the Netty able to use the same closeSession logic in NIOServerCnxn, which is more efficient with the sessionMap. Rely on the existing tests for the refactor work here.

Author: Fangmin Lyu <allenlyu@fb.com>

Reviewers: Tamás Pénzes, Enrico Olivelli, maoling, Michael Han

Closes #665 from lvfangmin/ZOOKEEPER-3163

3 months agoZOOKEEPER-3032: MAVEN MIGRATION - zookeeper-server
Norbert Kalmar [Fri, 19 Oct 2018 12:39:50 +0000 (14:39 +0200)] 
ZOOKEEPER-3032: MAVEN MIGRATION - zookeeper-server

Separating the java code is not feasible. Moving common and client back to server.

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: andor@apache.org

Closes #672 from nkalmar/ZOOKEEPER-3032r

3 months agoZOOKEEPER-3113: EphemeralType.get() fails to verify ephemeralOwner when currentElapse...
Andor Molnar [Thu, 18 Oct 2018 09:18:25 +0000 (11:18 +0200)] 
ZOOKEEPER-3113: EphemeralType.get() fails to verify ephemeralOwner when currentElapsedTime() is small enough

I refactored the unit test `testServerIds` to verify server id verification code explicitly instead of through `EphemeralType.get()` method.

Reasons:
- The original test doesn't work on machines which booted recently, because the generated `Time.currentElapsedTime()` value is not high enough and it's possible to generate a valid ephemeralOwner even with high 0xff byte. Server ID cannot be verified reliably this way.
- EphemeralType.get() is already covered in other unit tests,
- Unit tests should test the smallest piece of logic and call the method under testing directly.

Author: Andor Molnar <andor@apache.org>

Reviewers: fangmin@apache.org, eolivelli@gmail.com, hanm@apache.org, andor@apache.org

Closes #651 from anmolnar/ZOOKEEPER-3113 and squashes the following commits:

7454d7e7 [Andor Molnar] ZOOKEEPER-3113. Added unit tests to cover EphemeralType.get edge cases
47dece7a [Andor Molnar] ZOOKEEPER-3113. Refactored unit test to validate server Id verification code explicitly

4 months agoZOOKEEPER-236: SSL Support for Atomic Broadcast protocol (master)
Andor Molnar [Tue, 16 Oct 2018 14:22:07 +0000 (16:22 +0200)] 
ZOOKEEPER-236: SSL Support for Atomic Broadcast protocol (master)

Cherry-picked from branch-3.5.

Author: Andor Molnar <andor@apache.org>
Author: Abraham Fine <afine@apache.org>

Reviewers: hanm@apache.org, breed@apache.org

Closes #655 from anmolnar/ZOOKEEPER-236_master and squashes the following commits:

8c3aa11e [Andor Molnar] ZOOKEEPER-3165: Java 9: X509UtilTest.testCreateSSLContextWithoutTrustStorePassword fails
eb272749 [Abraham Fine] ZOOKEEPER-236: SSL Support for Atomic Broadcast protocol

4 months agoZOOKEEPER-3154: Update release process to use the MarkDown solution
Tamas Penzes [Mon, 15 Oct 2018 14:45:25 +0000 (16:45 +0200)] 
ZOOKEEPER-3154: Update release process to use the MarkDown solution

Added `mvn clean` and `mvn install` to `ant clean` and `ant compile` as dependency.
This way we clean and build zookeeper-docs maven sub-project when we clean and build main ant project.
Added releasenotes.md and fixed small issues in MarkDown files.

Next step is to remove not needed forrest content and dead ant code.
Only valid for master branch, do not backport to branch-3.4 or branch-3.5.
Adopted versions are coming.

Change-Id: I308a970c253be1bb82387516bf7b08bd7818a2c7

Author: Tamas Penzes <tamaas@cloudera.com>

Reviewers: andor@apache.org

Closes #661 from tamaashu/ZOOKEEPER-3154 and squashes the following commits:

43300182 [Tamas Penzes] ZOOKEEPER-3154: Removed HTML document generation which will be put back when maven migration will be done
9292169b [Tamas Penzes] ZOOKEEPER-3154: Fix mistyped version number in pom.xml files
ec2a71e6 [Tamas Penzes] ZOOKEEPER-3154: Update release process to use the MarkDown solution

4 months agoZOOKEEPER-3159: Flaky: ClientRequestTimeoutTest.testClientRequestTimeout
Andor Molnar [Fri, 12 Oct 2018 08:28:29 +0000 (10:28 +0200)] 
ZOOKEEPER-3159: Flaky: ClientRequestTimeoutTest.testClientRequestTimeout

Can't see a reason why testing again the create method without packet drop. Timeout scenario has already been tested and this part seem to make the test flaky. Removed.

Author: Andor Molnar <andor@apache.org>

Reviewers: nkalmar@cloudera.com, andor@apache.org

Closes #653 from anmolnar/ZOOKEEPER-3159

4 months agoZOOKEEPER-3161: Refactor QuorumPeerMainTest.java: move commonly used functions to...
Andor Molnar [Fri, 12 Oct 2018 08:25:27 +0000 (10:25 +0200)] 
ZOOKEEPER-3161: Refactor QuorumPeerMainTest.java: move commonly used functions to base class

Move the following methods to QuorumPeerTestBase.java:

- tearDown()
- LaunchServers()
- waitForOne(), waitForAll()
- logStates()

Author: Andor Molnar <andor@apache.org>

Reviewers: andor@apache.org

Closes #659 from anmolnar/ZOOKEEPER-3161

4 months agoZOOKEEPER-3157: Improve FuzzySnapshotRelatedTest to avoid flaky due to issues like...
Andor Molnar [Mon, 8 Oct 2018 12:42:09 +0000 (14:42 +0200)] 
ZOOKEEPER-3157: Improve FuzzySnapshotRelatedTest to avoid flaky due to issues like connection loss

Quick fix to make the test more reliable.

Author: Andor Molnar <andor@apache.org>

Reviewers: fangmin@apache.org, eolivelli@gmail.com, andor@apache.org

Closes #657 from anmolnar/ZOOKEEPER-3157

4 months agoZOOKEEPER-3106: Zookeeper client supports IPv6 address and document the "IPV6 feature"
maoling [Mon, 8 Oct 2018 12:33:38 +0000 (14:33 +0200)] 
ZOOKEEPER-3106: Zookeeper client supports IPv6 address and document the "IPV6 feature"

The related UTs in the `ConnectStringParserTest` have all passed,I also tested it in the real IPv6 ENV.
More details in [ZOOKEEPER-3106](https://issues.apache.org/jira/browse/ZOOKEEPER-3106)

Author: maoling <maoling199210191@sina.com>

Reviewers: andor@apache.org

Closes #587 from maoling/ZOOKEEPER-3106 and squashes the following commits:

22e20252 [maoling] fix a flaky test:ClientPortBindTest.testBindByAddress
4bb31f6f [maoling] rebase to solve the conflict in the zookeeperAdmin.xml
45091b91 [maoling] reuse the ConfigUtils.getHostAndPort()
fa984b51 [maoling] remove useless tab & add some annotations
bafc542a [maoling] ZOOKEEPER-3106: Zookeeper client supports IPv6 address and document the IPV6 feature

4 months agoZOOKEEPER-3153: Create MarkDown files and build process for them
Tamas Penzes [Fri, 5 Oct 2018 13:02:33 +0000 (15:02 +0200)] 
ZOOKEEPER-3153: Create MarkDown files and build process for them

In this sub-task we have transformed the Forest XML documents into MarkDown (.md) files and provided a (maven based) solution to create HTML documentation from them.
PDF support is dropped since it is not really used and makes everything overcomplicated.

The generated HTML content looks similar to the one generated from Forest XMLs, but not identical with them.

Change-Id: Id35984eca5d37b9e3074eab939be5c9b4cc80257

Author: Tamas Penzes <tamaas@cloudera.com>

Reviewers: andor@apache.org

Closes #643 from tamaashu/ZOOKEEPER-3153

4 months agoZOOKEEPER-3032: MAVEN MIGRATION - move java server, client
Norbert Kalmar [Fri, 5 Oct 2018 12:25:43 +0000 (14:25 +0200)] 
ZOOKEEPER-3032: MAVEN MIGRATION - move java server, client

Author: Norbert Kalmar <nkalmar@yahoo.com>

Reviewers: hanm@apache.org, andor@apache.org

Closes #633 from nkalmar/ZOOKEEPER-3032 and squashes the following commits:

3f9a0eca [Norbert Kalmar] ZOOKEEPER-3032 fix flaky QuorumPeerMainTest.testLeaderElectionWithDisloyalVoter_stillHasMajority
27295ed6 [Norbert Kalmar] ZOOKEEPER-3032 - MAVEN MIGRATION - move java server, client

4 months agoZOOKEEPER-1908: setAcl should be have a recursive function
Reid Chan [Thu, 4 Oct 2018 13:46:28 +0000 (15:46 +0200)] 
ZOOKEEPER-1908: setAcl should be have a recursive function

Let setAcl support recursive option, a UT is included.

Author: Reid Chan <reidchan@apache.org>

Reviewers: fangmin@apache.org, andor@apache.org

Closes #650 from Reidddddd/ZOOKEEPER-1908 and squashes the following commits:

2d0b33fd [Reid Chan] ZOOKEEPER-1908: Address review comments
9c9c1bb9 [Reid Chan] ZOOKEEPER-1908: Add unit test for setAcl recursive
9ec3d837 [Reid Chan] ZOOKEEPER-1908: setAcl should be have a recursive function

4 months agoZOOKEEPER-2847: Cannot bind to client port when reconfig based on old static config
Yisong Yue [Mon, 1 Oct 2018 04:11:18 +0000 (21:11 -0700)] 
ZOOKEEPER-2847: Cannot bind to client port when reconfig based on old static config

PR No.2: Prevent removing client info from static config file to fix ReconfigLegacyTest

Author: Yisong Yue <yisongyue@fb.com>

Reviewers: Allan Lyu <fangmin@apache.org>, Michael Han <hanm@apache.org>

Closes #649 from yisong-yue/ZOOKEEPER-2847