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 C7465102C9 for ; Wed, 7 Jan 2015 00:39:48 +0000 (UTC) Received: (qmail 88168 invoked by uid 500); 7 Jan 2015 00:39:49 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 88112 invoked by uid 500); 7 Jan 2015 00:39:49 -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 88100 invoked by uid 500); 7 Jan 2015 00:39:48 -0000 Delivered-To: apmail-hadoop-zookeeper-user@hadoop.apache.org Received: (qmail 88097 invoked by uid 99); 7 Jan 2015 00:39:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2015 00:39:48 +0000 X-ASF-Spam-Status: No, hits=4.5 required=5.0 tests=HTML_MESSAGE,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of i.s.el-sanosi@newcastle.ac.uk does not designate 162.253.133.43 as permitted sender) Received: from [162.253.133.43] (HELO mwork.nabble.com) (162.253.133.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2015 00:39:43 +0000 Received: from mjim.nabble.com (unknown [162.253.133.84]) by mwork.nabble.com (Postfix) with ESMTP id D2AB5FB88E4 for ; Tue, 6 Jan 2015 16:38:22 -0800 (PST) Date: Tue, 6 Jan 2015 17:38:22 -0700 (MST) From: Ibrahim To: zookeeper-user@hadoop.apache.org Message-ID: In-Reply-To: References: <2015010515052731525120@163.com> <1420576908112-7580736.post@n2.nabble.com> <1420587767194-7580739.post@n2.nabble.com> <4CA88BC6-AE69-4184-9024-7BE364103338@fb.com> Subject: RE: Question about the two-phrase commit MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_13288_2049968208.1420591102641" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_13288_2049968208.1420591102641 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you Alexander. I get it Ibrahim From: Alexander Shraer-2 [via zookeeper-user] [mailto:ml-node+s578899n75807= 45h19@n2.nabble.com] Sent: Wednesday, January 07, 2015 12:29 =D8=B5 To: Ibrahim El-sanosi (PGR) Subject: Re: Question about the two-phrase commit Edward is totally right - if the operation hasn't been acked by a quorum then whether or not it is lost depends on failures (both server failures and network failures) as well as latencies. The leader doesn't have to re-broadcast everything - when a follower connects to a leader it tells him whats the last operation in its log and the leader only needs to send the missing log suffix or a snapshot + suffix if the follower is really behind. The leader indeed doesn't know which operations were acked by a quorum. The operations that weren't acked are always some suffix of the log (potentially empty). On Tue, Jan 6, 2015 at 4:19 PM, Ibrahim <[hidden email]> wrote: > Thank you Edward for replaying. > > In my opinion, your first case can=E2=80=99t happen, because the election > mechanism will elect the node that has the latest transaction (zxid) see= n. > In this case, it will be only your second case is correct, unless the nod= e > that has latest transaction crashes forever. > > Ibrahim > From: Edward Carter [via zookeeper-user] [mailto: > [hidden email]] > Sent: Tuesday, January 06, 2015 11:53 =D9=85 > To: Ibrahim El-sanosi (PGR) > Subject: Re: Question about the two-phrase commit > > If an operation is logged to disk on a minority of servers, then what > happens on restart depends on which server wins the leader election. Sin= ce > the new operation is on a minority, depending on network conditions, a > server that did *not* log the operation might win the leader election. I= n > this case, the operation will be discarded. If a server that *did* log t= he > operation wins the leader election (as would be the case in the absence o= f > network or latency issues), then the operation will be propagated to the > remaining servers in the ensemble. > > Edward > > On Jan 6, 2015, at 3:42 PM, Ibrahim <[hidden > email]> wrote: > > > Hi Alexander, > > > > So, you meant that if there is operation loged to the disk but it hasn'= t > got > > enough majority, then if the zookeeper servers restart, the new leader > will > > re-broadcast the loged operation again to the followers to commit that > > operation. > > > > Does above what you meant by (NEWLEADER message acts as the accept and > > UPTODATE message acts as commit). > > > > Am I right? > > > > Thank you > > > > Ibrahim > > > > > > > > -- > > View this message in context: > https://urldefense.proofpoint.com/v1/url?u=3Dhttp://zookeeper-user.578899= .n2.nabble.com/Question-about-the-two-phrase-commit-tp7580725p7580739.html&= k=3DZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=3D09h%2FR60Z1NzKuJcTv9DkEw%3D%3D%0A&m= =3DT7mEM8unY7tsVTbHXoSOqvwXEZEBCs8%2BRWl0cT03ruo%3D%0A&s=3Dbcce5c88300c5112= 6777473143b3f560542cf1c5699b33283f888e27ed41529f > > Sent from the zookeeper-user mailing list archive at Nabble.com. > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > > http://zookeeper-user.578899.n2.nabble.com/Question-about-the-two-phrase-= commit-tp7580725p7580741.html > To unsubscribe from Question about the two-phrase commit, click here< > >. > NAML< > http://zookeeper-user.578899.n2.nabble.com/template/NamlServlet.jtp?macro= =3Dmacro_viewer&id=3Dinstant_html%21nabble%3Aemail.naml&base=3Dnabble.naml.= namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.v= iew.web.template.NodeNamespace&breadcrumbs=3Dnotify_subscribers%21nabble%3A= email.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble= %3Aemail.naml > > > > > > > -- > View this message in context: > http://zookeeper-user.578899.n2.nabble.com/Question-about-the-two-phrase-= commit-tp7580725p7580743.html > Sent from the zookeeper-user mailing list archive at Nabble.com. > ________________________________ If you reply to this email, your message will be added to the discussion be= low: http://zookeeper-user.578899.n2.nabble.com/Question-about-the-two-phrase-co= mmit-tp7580725p7580745.html To unsubscribe from Question about the two-phrase commit, click here. NAML -- View this message in context: http://zookeeper-user.578899.n2.nabble.com/Qu= estion-about-the-two-phrase-commit-tp7580725p7580746.html Sent from the zookeeper-user mailing list archive at Nabble.com. ------=_Part_13288_2049968208.1420591102641--