From user-return-11447-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu May 10 23:26:40 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 6243418063A for ; Thu, 10 May 2018 23:26:40 +0200 (CEST) Received: (qmail 22826 invoked by uid 500); 10 May 2018 21:26:34 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 22804 invoked by uid 99); 10 May 2018 21:26:33 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2018 21:26:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 182EE1A18D7 for ; Thu, 10 May 2018 21:26:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id MMbZAftcGZUc for ; Thu, 10 May 2018 21:26:31 +0000 (UTC) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EEEB85F24C for ; Thu, 10 May 2018 21:26:30 +0000 (UTC) Received: by mail-oi0-f46.google.com with SMTP id v2-v6so3052245oif.3 for ; Thu, 10 May 2018 14:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudera.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=rbrghPjC6MYJxdafyfX9gEgfhkXSh+qj1VhEfg0zAGs=; b=TzR3P0ObePro86Dx6Dw2GrFiDcF8nfP40xB4FDPsAoo3zAi5HwJ3Js8Tf8I/VXsq/C lxBvrsV3zyLzWTHry/HuiOxjtS4ygG2DrCHfr3bXLRh7yFMkAMc+URXbqyCuez+4jcnp 9v+oIll5CEENrv/P/FsFD3/5d6z1Yuj1623aKB64TzHm9kshyZlNnyGYkyat4/wfgS6a v35ED9/InbzR6F1R/zaYCkXi2H4komn6GQabum9xgBR63rJU8gFRA4fJDuX6k3ZFfnDw vaeNwTiI6AhkRtRlGL1nGzQleLuCycqazkW2ZaNrG8v9WfF1MEKVzk0sjVOkNsu7Ub7o DSGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=rbrghPjC6MYJxdafyfX9gEgfhkXSh+qj1VhEfg0zAGs=; b=iuGzuPtbWdLHbYigxDY39aO4yTUDy3ApsAY9TXOi1BntYezcg7nbWT+GDQm5thtwe7 Fdpt57CmwZzw+P77Udn0ioWZA9/0MeFOyGUMNXAyWsAIPLox8aNCFj+nZ50AtV+UeAdU U4cwoPE/0IfF6Vn+XMNebr5m/KEa/PiGwkNO3cGLqep4ngZ5hp7bRKxGgr9QB6EBU+yi jTTCsSsgHQ/NCf9+TYYqOUKj4y6/iTMLGhFVNyM6jFloULx84cbYL6N7J9SqNl0w7YaT koimajKx+WiCFS9LgM855usF9RdYjuwU8aFj4Atq0jzaRnhv3VbpBz/4Px4jzMPwAS7N os7w== X-Gm-Message-State: ALKqPwdN577m3hAn+rAPMh/Mz+MD4O9tZ3Qas8T7zwufTdm9MiJXCQIe QzWcFdLFs9eZnKFSwUXOy9Bbn9B5HMDjKrtHSi05g4dL X-Google-Smtp-Source: AB8JxZr2FIh8eL3rPEFeMuhwr+SkDOBdG/i5OGL9ylmoM+AHhb36jJlQMeiqsqgzx5uho20+FxDpMFkUZYw3fKsMzgg= X-Received: by 2002:aca:cd4e:: with SMTP id d75-v6mr1860051oig.291.1525987589536; Thu, 10 May 2018 14:26:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:fc3:0:0:0:0:0 with HTTP; Thu, 10 May 2018 14:26:29 -0700 (PDT) In-Reply-To: References: <32016705-7D40-4F42-80FA-A6591F8FD6EF@jordanzimmerman.com> From: Andor Molnar Date: Thu, 10 May 2018 14:26:29 -0700 Message-ID: Subject: Re: Leader elections between 2 nodes. To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary="0000000000003505af056be0ac38" --0000000000003505af056be0ac38 Content-Type: text/plain; charset="UTF-8" You cannot read from ZooKeeper if there's no quorum, because it rejects client connections. But when you can, the request doesn't go to the leader, it served directly from the server that client is connected to. As a consequence, you cannot read stale data from ZooKeeper. Andor On Thu, May 10, 2018 at 1:36 PM, David Brower wrote: > Without quorum, the client has no idea how current the read data may be. > It might be from a replica that is hours/days/weeks out of data. > Sometimes this won't matter, sometimes it will be a critical failing. > > -dB > > > > On 5/9/2018 6:40 PM, Prasanth Mathialagan wrote: > >> For reads, is Quorum necessary? Reads are served from local the local >> replica, right? >> >> On Wed, May 9, 2018 at 8:29 AM, Jordan Zimmerman < >> jordan@jordanzimmerman.com >> >>> wrote: >>> A quorum means (n/2)+1 - In a 3 node cluster that is 2. So, if 2 servers >>> are up you can achieve quorum. >>> >>> we need odd >>>> numbers in order to form a quorum >>>> >>> The "odd" in this formula refers to the number of configured servers not >>> how many are running at a given time. That's the reasoning for quorum in >>> the first place. Quorum I/O ensures that a majority of nodes is >>> referenced >>> for reads or writes (in ZooKeeper writes are what matter for quorum). >>> >>> -Jordan >>> >>> On May 9, 2018, at 10:26 AM, Kaushal Shriyan >>>> >>> wrote: >>> >>>> Hi, >>>> >>>> In a ensemble of 3 nodes with 1 leader and 2 followers, if the leader >>>> >>> goes >>> >>>> down then two servers can elect a leader among themselves. But we need >>>> >>> odd >>> >>>> numbers in order to form a quorum. I am confused. Please correct me if i >>>> >>> am >>> >>>> understanding it wrong. >>>> >>>> Any help will be highly appreciable >>>> >>>> Best Regards, >>>> >>>> Kaushal >>>> >>> >>> > --0000000000003505af056be0ac38--