From dev-return-79303-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Sun Mar 17 08:29:15 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2CA26180629 for ; Sun, 17 Mar 2019 09:29:15 +0100 (CET) Received: (qmail 65074 invoked by uid 500); 17 Mar 2019 08:29:14 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 65063 invoked by uid 99); 17 Mar 2019 08:29:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Mar 2019 08:29:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8BECEC619E for ; Sun, 17 Mar 2019 08:29:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 9u5uQEhAx59f for ; Sun, 17 Mar 2019 08:29:12 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4D0C760F6F for ; Sun, 17 Mar 2019 08:29:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8491FE00A7 for ; Sun, 17 Mar 2019 08:29:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 13FB224595 for ; Sun, 17 Mar 2019 08:29:00 +0000 (UTC) Date: Sun, 17 Mar 2019 08:29:00 +0000 (UTC) From: "Igor Skokov (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ZOOKEEPER-3320) Leader election port stop listen when hostname unresolvable for some time MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-3320?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Skokov updated ZOOKEEPER-3320: ----------------------------------- Summary: Leader election port stop listen when hostname unresolvable fo= r some time (was: Don't give up on bind of leader election port) > Leader election port stop listen when hostname unresolvable for some time= =20 > -------------------------------------------------------------------------= - > > Key: ZOOKEEPER-3320 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3320 > Project: ZooKeeper > Issue Type: Bug > Components: leaderElection > Affects Versions: 3.4.10, 3.5.4 > Reporter: Igor Skokov > Priority: Major > > When trying to run Zookeeper 3.5.4 cluster on Kubernetes, I found out tha= t in some circumstances Zookeeper node stop listening on leader election po= rt. This cause unavailability of ZK cluster.=20 > Zookeeper deployed =C2=A0as StatefulSet in term of Kubernetes and has fol= lowing dynamic configuration: > {code:java} > zookeeper-0.zookeeper:2182:2183:participant;2181 > zookeeper-1.zookeeper:2182:2183:participant;2181 > zookeeper-2.zookeeper:2182:2183:participant;2181 > {code} > Bind address contains DNS name which generated by Kubernetes for each Sta= tefulSet pod. > These DNS names will become resolvable after container start, but with so= me delay. That delay cause stopping of leader election port listener in Quo= rumCnxManager.Listener class. > Error happens in QuorumCnxManager.Listener "run" method, it tries to bind= leader election port to hostname which not resolvable at this moment. Retr= y count is hard-coded and equals to 3(with backoff of 1 sec).=20 > Zookeeper server log contains following errors: > {code:java} > 2019-03-17 07:56:04,844 [myid:1] - WARN [QuorumPeer[myid=3D1](plain=3D/0= .0.0.0:2181)(secure=3Ddisabled):QuorumPeer@1230] - Unexpected exception > java.net.SocketException: Unresolved address > =09at java.base/java.net.ServerSocket.bind(ServerSocket.java:374) > =09at java.base/java.net.ServerSocket.bind(ServerSocket.java:335) > =09at org.apache.zookeeper.server.quorum.Leader.(Leader.java:241) > =09at org.apache.zookeeper.server.quorum.QuorumPeer.makeLeader(QuorumPeer= .java:1023) > =09at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:1= 226) > 2019-03-17 07:56:04,844 [myid:1] - WARN [QuorumPeer[myid=3D1](plain=3D/0= .0.0.0:2181)(secure=3Ddisabled):QuorumPeer@1261] - PeerState set to LOOKING > 2019-03-17 07:56:04,845 [myid:1] - INFO [QuorumPeer[myid=3D1](plain=3D/0= .0.0.0:2181)(secure=3Ddisabled):QuorumPeer@1136] - LOOKING > 2019-03-17 07:56:04,845 [myid:1] - INFO [QuorumPeer[myid=3D1](plain=3D/0= .0.0.0:2181)(secure=3Ddisabled):FastLeaderElection@893] - New election. My = id =3D 1, proposed zxid=3D0x0 > 2019-03-17 07:56:04,846 [myid:1] - INFO [WorkerReceiver[myid=3D1]:FastLe= aderElection@687] - Notification: 2 (message format version), 1 (n.leader),= 0x0 (n.zxid), 0xf (n.round), LOOKING (n.state), 1 (n.sid), 0x0 (n.peerEPoc= h), LOOKING (my state)0 (n.config version) > 2019-03-17 07:56:04,979 [myid:1] - INFO [zookeeper-0.zookeeper:2183:Quor= umCnxManager$Listener@892] - Leaving listener > 2019-03-17 07:56:04,979 [myid:1] - ERROR [zookeeper-0.zookeeper:2183:Quor= umCnxManager$Listener@894] - As I'm leaving the listener thread, I won't be= able to participate in leader election any longer: zookeeper-0.zookeeper:2= 183 > {code} > This error happens on most nodes on cluster start and Zookeeper is unable= to form quorum. This will leave cluster in unusable state. > As I can see, error present on branches 3.4 and 3.5.=20 > I think, this error can be fixed by configurable number of retries(instea= d of hard-coded value of 3).=20 > Other way to fix this is removing of max retries at all. Currently, ZK se= rver only stop leader election listener and continue to serve on other port= s. May be, if leader election halts, we should abort process. -- This message was sent by Atlassian JIRA (v7.6.3#76005)