From user-return-12253-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Sun Oct 27 06:11:58 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 95C5A180630 for ; Sun, 27 Oct 2019 07:11:58 +0100 (CET) Received: (qmail 84419 invoked by uid 500); 27 Oct 2019 06:11:56 -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 84407 invoked by uid 99); 27 Oct 2019 06:11:55 -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; Sun, 27 Oct 2019 06:11:55 +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 0BE1C1A318C for ; Sun, 27 Oct 2019 06:11:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.2 X-Spam-Level: X-Spam-Status: No, score=-0.2 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id FLccPFkbD44l for ; Sun, 27 Oct 2019 06:11:54 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::12f; helo=mail-il1-x12f.google.com; envelope-from=openlinuxsource@gmail.com; receiver= Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 607F57DDF8 for ; Sun, 27 Oct 2019 06:11:53 +0000 (UTC) Received: by mail-il1-x12f.google.com with SMTP id b12so3354176ilf.12 for ; Sat, 26 Oct 2019 23:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=DUjMitfr1fYXxh8J4q1tXLxwXRl6PKKUN9GA6daOBKs=; b=GwfzoEg60dqoNY/zX31xhxASomWSI/t4nek6baWalpY9DIItSGaU4V1s/KebI+lvRQ PTh1v8otVcH2M3n9GagNxdRe7Ocy2epHaM7hKp4+wmRS7RlXUJeUP+Kmy6apefXMwq+v Ly/gLb8ILfkSuW1BjBFF1Q1q2RbpqYT+DEqYs5ERLAh/rYHfhuI+6mEIjEFj1/+mswLa ONS5x6i36oP29UABdMjpDytJDaXdt9TMiOg0NOqPHADufxjGLybtdjT6Rr8g5ifu82e5 gAkDhMxNTi0I1zxp8CpK4aVg95UTu2+ZegwbAPnzHswUb+jbenEK2arXfDN0PKimHLMv hs3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DUjMitfr1fYXxh8J4q1tXLxwXRl6PKKUN9GA6daOBKs=; b=GnHjOQc+YTe8NEXnEvyhJPmGqKjA4qcGMC4EFOdsWyQ749j7HUZVCQ4If+OYHrCcCj BCEflvMCuTFMJ4+Sv2sDXoeR5YEJnImySyZTKTK529ZrrkRR+bn9AByjc06b9qM0Xl/d KYQ7CTXQAgEmMRBZbZPibB5hyFQu5pUjiqoci0ij2MkdxvNuQIUEGUzwpU3kGT9uP7C6 gJkPl9+QKbI/hpYD7CODSjh2+3z5oa4hbBEGEqRHr3E98LaqSQqz+BoEyeN0Lk5ErHbK GHUMWyNu8aVtbL+wrHVYrdhY/WH4RtJbADotaw2eYAYEvmZ3kkjqkMxMpPLKshXLm/qO 02AA== X-Gm-Message-State: APjAAAXP6V/PSNQpntnGZzecsYYboDdx1y5Jf25kZ4/ykhqTKZjEGDyi vNEljGd+PX2nOg9/GgFcMDjOh9r4Wj7a0qsaZ0tr3sK1wjg= X-Google-Smtp-Source: APXvYqx9wkZQKkAwSdKhDeVYhMNx7uScO4UNkQUkF/Uds0eqnY40IGb3eqMzTb2ozaPJ7EdKUhBO1HHbzXICYqBMmfM= X-Received: by 2002:a92:9c16:: with SMTP id h22mr13484502ili.67.1572156711472; Sat, 26 Oct 2019 23:11:51 -0700 (PDT) MIME-Version: 1.0 From: Lee Eric Date: Sat, 26 Oct 2019 23:11:40 -0700 Message-ID: Subject: ZooKeeper Leader Election Question To: user@zookeeper.apache.org Content-Type: text/plain; charset="UTF-8" Hi, I have a dumb question about the way how zookeeper does leader election. There is a quorum zk1(1,6), zk2(2,5) and zk3(3,5). The number in parentheses is sid and latest zxid. So my question is, when each server sends out the vote to other 2, say, zk1 and zk2 send the votes to zk3. So zk3 has 2 votes (1,6) and (2,5). Now, based on the rules: 1. If (voteZxid > myZxid) or (voteZxid = myZxid and voteId > mySid), keep the current vote. 2. Otherwise, change my vote by assigning myZxid to voteZxid and mySid to vote Zxid. So what zk3 vote would be? I'm confused because to compare zk1 and zk3, the vote on zk3 is (1,6); but to compare zk2 and zk3, zk3 should keep its vote. So in this case, how the vote should be settled? Thanks. Eric