From dev-return-71730-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Jul 23 07:31:09 2018 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 A8A17180647 for ; Mon, 23 Jul 2018 07:31:08 +0200 (CEST) Received: (qmail 79781 invoked by uid 500); 23 Jul 2018 05:31:02 -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 79770 invoked by uid 99); 23 Jul 2018 05:31:02 -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; Mon, 23 Jul 2018 05:31:02 +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 D43CFC14AF for ; Mon, 23 Jul 2018 05:31:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, 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-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BGrtQb9qFPsI for ; Mon, 23 Jul 2018 05:31:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 239885F18F for ; Mon, 23 Jul 2018 05:31:01 +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 719D3E0047 for ; Mon, 23 Jul 2018 05:31:00 +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 04DB623F97 for ; Mon, 23 Jul 2018 05:31:00 +0000 (UTC) Date: Mon, 23 Jul 2018 05:31:00 +0000 (UTC) From: "Jiafu Jiang (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: =?utf-8?Q?[jira]_[Created]_(ZOOKEEPER-3099)_Zoo?= =?utf-8?Q?Keeper_cluster_is_unavailable_for_ses?= =?utf-8?Q?sion=5Ftimeout_time_when_the_leader_shu?= =?utf-8?Q?tdown_in_a_three-node_environment.__=C2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Jiafu Jiang created ZOOKEEPER-3099: -------------------------------------- Summary: ZooKeeper cluster is unavailable for session_timeout = time when the leader shutdown in a three-node environment. =C2=A0 Key: ZOOKEEPER-3099 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3099 Project: ZooKeeper Issue Type: Bug Components: c client, java client Affects Versions: 3.4.13, 3.4.12, 3.5.4, 3.4.11 Reporter: Jiafu Jiang =C2=A0 The default readTimeout timeout of ZooKeeper client is 2/3 * session_time, = the default connectTimeout is session_time/hostProvider.size(). If the ZooK= eeper cluster has 3 nodes, then connectTimeout is 1/3 * session_time. =C2=A0 Supports we have three ZooKeeper servers: zk1, zk2, zk3 deployed. And zk3 i= s now the leader. Client c1 is now connected to zk2(follower). Then we shut= down the network of zk3(leader), the same time, client c1 begin to write so= me data to ZooKeeper. After a (syncLimit * tick) timeout, zk2 will disconne= ct with leader and begin a new election, and zk2 becomes the leader. =C2=A0 The write operation will not succeed due to the leader is shutdown. It will= take at most readTimeout time for c1 to discover the failure, and client c= 1 will try to choose another ZooKeeper server. Unfortunately, c1 may choose= zk3, which is unreachable now, then c1 will spend connectTimeout to find o= ut that zk3 is unused. Notice that readTimeout + connectTimeout =3D sesstio= n_timeout in my case(three-node cluster). =C2=A0 Therefore, in this case, the ZooKeeper cluster is unavailable for session t= imeout time when only one ZooKeeper server is shutdown. =C2=A0 I have some suggestions: # The HostProvider used by ZooKeeper can be specified by an argument. # readTimeout can also be specified in any way. =C2=A0 =C2=A0 =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)