You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Tianyin Xu (JIRA)" <ji...@apache.org> on 2014/11/14 23:42:34 UTC
[jira] [Created] (ZOOKEEPER-2082) Mistype of electionAlgo can fill
out your disk in minutes
Tianyin Xu created ZOOKEEPER-2082:
-------------------------------------
Summary: Mistype of electionAlgo can fill out your disk in minutes
Key: ZOOKEEPER-2082
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2082
Project: ZooKeeper
Issue Type: Bug
Components: leaderElection
Affects Versions: 3.4.6
Environment: Cluster (multi-server) setup
Reporter: Tianyin Xu
Priority: Minor
The parameter, electionAlgo, is supposed to be 0--3. However, when I mistyped the value in my zoo.cfg (I'm stupid), ZK falls into a dead loop and starts filling up the entire disk which millions of the follow 2 lines...
2014-11-14 14:28:44,588 \[myid:3\] - INFO \[QuorumPeer\[myid=3\]/0:0:0:0:0:0:0:0:2183:QuorumPeer@714\] - LOOKING
2014-11-14 14:28:44,588 \[myid:3\] - WARN \[QuorumPeer\[myid=3\]/0:0:0:0:0:0:0:0:2183:QuorumPeer@764\] - Unexpected exception
java.lang.NullPointerException
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:762)
The error rooted in createElectionAlgorithm() where an invalid setting leads to null for the Election object. Then, in the while look in run(), it causes null-pointer de-referencing which is captured but is not handled well.
I think our should check the setting of electionAlg in the very beginning to make sure it's a valid setting, instead of using it at runtime and cause the unfortunate things.
Let me know if you wanna a patch. I'd like to check it in the parseProperties() function in QuorumPeerConfig.java.
Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)