Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AAF8410B2D for ; Fri, 4 Apr 2014 17:20:01 +0000 (UTC) Received: (qmail 24823 invoked by uid 500); 4 Apr 2014 17:20:00 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 23980 invoked by uid 500); 4 Apr 2014 17:19:58 -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 23957 invoked by uid 500); 4 Apr 2014 17:19:57 -0000 Delivered-To: apmail-hadoop-zookeeper-user@hadoop.apache.org Received: (qmail 23942 invoked by uid 99); 4 Apr 2014 17:19:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2014 17:19:56 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=RCVD_IN_BRBL_LASTEXT,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [193.1.99.77] (HELO gir.skynet.ie) (193.1.99.77) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2014 17:19:49 +0000 Received: from ip-10-228-174-15.eu-west-1.compute.internal (ec2-54-247-85-211.eu-west-1.compute.amazonaws.com [54.247.85.211]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by gir.skynet.ie (Postfix) with ESMTPSA id E8171124D7; Fri, 4 Apr 2014 18:19:24 +0100 (IST) Date: Fri, 4 Apr 2014 17:18:20 +0000 From: Ivan Kelly To: user@zookeeper.apache.org Cc: zookeeper-user@hadoop.apache.org Subject: Re: What should be the majority in an ensemble for Zookeeper Message-ID: <20140404171819.GB12544@ip-10-228-174-15.eu-west-1.compute.internal> References: <1396550716641-7579721.post@n2.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396550716641-7579721.post@n2.nabble.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Apr 03, 2014 at 11:45:16AM -0700, chaitanya_r wrote: > "Say that we use four servers for an ensemble. A majority of servers is > comprised of three servers. However, this system will only tolerate a single > crash, because a double crash makes the system lose majority. Consequently, > with four servers, we can only tolerate a single crash, but quorums now are > larger, which implies that we need more acknowledgments for each request. > The bottom line is that we should always shoot for an odd number of > servers." > > How do we select the majority of servers for a given ensemble? A majority is half the servers plus one. It can be any subset of the servers in the ensemble. In the case of 4 servers, a majority is any 3 ((4/2) + 1) servers. If there were 20 servers in the ensemble, the majority is 11 ((10/2) + 1). If there are 3 servers, the majority is 2 ((3/2) + 1). The point this paragraph is making is that having an even number of servers in an ensemble is pointless. You don't increase fault tolerance, but the number of machines you must communicate with to agree on an update is higher. For example, with an ensemble of 3, you have to communicate with 2 machines, and can tolerate 1 failure. With an ensemble of 4, you have to communicate with _3_ machines, but can still only tolerate 1 failure. With an ensemble of 5, you have to communicate with only 3, but now you can tolerate 2 failures. -Ivan