Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 25215200D3C for ; Tue, 14 Nov 2017 17:56:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 23C0F160C07; Tue, 14 Nov 2017 16:56:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 420DE160BD7 for ; Tue, 14 Nov 2017 17:56:08 +0100 (CET) Received: (qmail 29608 invoked by uid 500); 14 Nov 2017 16:56:07 -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 29585 invoked by uid 99); 14 Nov 2017 16:56:06 -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; Tue, 14 Nov 2017 16:56:06 +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 0E6BBC87A3; Tue, 14 Nov 2017 16:56:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.63 X-Spam-Level: ** X-Spam-Status: No, score=2.63 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 t62nnLn6zGgO; Tue, 14 Nov 2017 16:56:04 +0000 (UTC) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6A30E5FAC5; Tue, 14 Nov 2017 16:56:04 +0000 (UTC) Received: by mail-wm0-f47.google.com with SMTP id z3so13014350wme.3; Tue, 14 Nov 2017 08:56:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7vFbk4w+D1t1MYUAWcZMWHyd5hQHDSlv+CT1KaC73tE=; b=PpJ+GfbdLtQTOmWAVTGnPxmEKhnPaTvRb2UxJkQrWcqtAdJs+8xqGfKpf+RtTgN88R fri6VsmB90wqVtD6jb90cEDddeET9+NvCfE7boKVqLugphy3udgPv5ReSF2YSYwL4HK9 x7RJbArXbIuUP95RhbV6XEV9mgov1F1GithQeOyGxyz2hEdW3v3dEEXEbSHICA/PoH5t EHAqj374O3lQdWfKimtzMM7stt1/nQTiNHDJpSaQVAqHO8rUPJojVz7Bkrh5bJsyz/uh 2e5SjpvLFLpzpFv9ynY80mtARa1auskQluJQ0Bb3Hpa7K3OFPVQBWW7KC54W7GjCUen3 +asg== 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:cc; bh=7vFbk4w+D1t1MYUAWcZMWHyd5hQHDSlv+CT1KaC73tE=; b=UpELeDVi9pBdXMeI1BVw8JFNIATroS03yY/YWE6Aqer8K8OJczdqXXkfbxDpDFKW34 4zBBENtLTNuL+EEkWblGKsP42l6DI5OHoorDL3T1DcnsdkiKxcTE62GXveN+5B3Gt/kl vu7SgkPcLtseVLUcNYgW48J/kKtYuS3zCfJIQFihdPFjRLaSUt0jLDvFWxIoytLDKALD jn8KXS9P6lFlR5L/5HSxhw7ynaf88y7kwRYDscXtH2KGin7lwAXHUYUGW+0tZaob3A0t o0daQyd3UoqO4qZDWCeoZ5p4vCp+89vtyx+eoyDbn/VuIYuQjcsJHA1CN3T+bz+23ASL g1IQ== X-Gm-Message-State: AJaThX4XbxIhhPsQIiWe/ov7UPU84lYJfGG6Q5LYvBZJGQbjarIV4Zk0 LWO7g43gYcvN2rHjzKx/qh+G5J/6NtFYRnRPuTFiEw== X-Google-Smtp-Source: AGs4zMbw+2W60STlFLmiyxrEUe8l4T3g92lj2L18xuHjI+FUWrycTccxrnx18XrIgKIcFDVftKdbYyomXi6uQIGPGgs= X-Received: by 10.80.178.132 with SMTP id p4mr18744930edd.113.1510678562918; Tue, 14 Nov 2017 08:56:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.145.54 with HTTP; Tue, 14 Nov 2017 08:55:42 -0800 (PST) In-Reply-To: References: <1510618325.2966293.1171459416.240F2D1D@webmail.messagingengine.com> From: Alexander Shraer Date: Tue, 14 Nov 2017 08:55:42 -0800 Message-ID: Subject: Re: how zookeeper promise FIFO client order To: "dev@zookeeper.apache.org" Cc: "user@zookeeper.apache.org" , andor@cloudera.com, afine@apache.org Content-Type: multipart/alternative; boundary="f403045c82041cd62f055df4437d" archived-at: Tue, 14 Nov 2017 16:56:09 -0000 --f403045c82041cd62f055df4437d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Specific implementations of Raft may guarantee client program order, but I don't think that it directly follows from tcp order + state machine. It matters whether commands are committed to the log according to program order. For example, here's an implementation that seems to be doing this: http://atomix.io/copycat/docs/client-interaction/#preserving-program-order = In any case, this is probably not the right forum for Raft questions :) I'm not sure we want to do command queueing on the leader like in the link above or maybe just reset the client session if we're missing requests. In any case, perhaps this is worth a discussion on a JIRA. What do others think ? Baotiao, would you like to open one ? Thanks, Alex On Tue, Nov 14, 2017 at 2:41 AM, baotiao wrote: > Hi Andor > > Another question is that if zookeeper only promise channel FIFO order, I > think raft that build upon tcp also promise FIFO client order, since ther > FIFO order is promise by the tcp connection, and almost all consensus > algorithm apply the log to state machine in order. > > if I misunderstand any thing, please tell me. > > > > ---------------------------------------- > > Github: https://github.com/baotiao > Blog: http://baotiao.github.io/ > Stackoverflow: http://stackoverflow.com/users/634415/baotiao > Linkedin: http://www.linkedin.com/profile/view?id=3D145231990 > > > On 14 Nov 2017, at 13:08, Andor Molnar wrote: > > > > Oh, I see your problem now. > > Abe is right, you can find find the best answer in the book and the sho= rt > > answer is, yes, it only promises channel fifo order. > > > > Regards, > > Andor > > > > > > On Tue, Nov 14, 2017 at 4:04 AM, baotiao wrote: > > > >> Hello Abraham > >> > >> right, exactly. > >> > >> my confusion is that the client FIFO order is for a client or only for= a > >> tcp connection > >> ---------------------------------------- > >> > >> Github: https://github.com/baotiao > >> Blog: http://baotiao.github.io/ > >> Stackoverflow: http://stackoverflow.com/users/634415/baotiao > >> Linkedin: http://www.linkedin.com/profile/view?id=3D145231990 > >> > >>> On 14 Nov 2017, at 08:12, Abraham Fine wrote: > >>> > >>> Hello- > >>> > >>> My understanding is that the question is about the possibility of a > race > >>> condition between two client requests. I would take a look at the > >>> section "Order in the Presence of Connection Loss" in the "ZooKeeper: > >>> Distributed Process Coordination" book for the best answer to this > >>> question. > >>> > >>> Thanks, > >>> Abe > >>> > >>> On Mon, Nov 13, 2017, at 06:17, Andor Molnar wrote: > >>>> Hi baotiao, > >>>> > >>>> First, requests are acknowledged back to the client once the leader > >>>> accepted and written them in its transaction log, which guarantees > that > >>>> in > >>>> case of a crash, pending transactions can be processed on restart. > >>>> Transactions IDs (zxid) are incremental and generated by the leader. > >>>> Second, Zab guarantees that if the leader broadcast T and T' in that > >>>> order, > >>>> each server must commit T before committing T'. > >>>> > >>>> With these 2 promises, I believe, that FIFO is guaranteed by > Zookeeper. > >>>> > >>>> Would you please clarify that what do you mean by "set b=3D1 operati= on > is > >>>> on > >>>> the way"? > >>>> > >>>> If "set b=3D1" is accepted by the leader, the client won't have to > resend > >>>> it > >>>> on reconnect. > >>>> > >>>> Regards, > >>>> Andor > >>>> > >>>> > >>>> On Mon, Nov 13, 2017 at 5:01 AM, =E9=99=88=E5=AE=97=E5=BF=97 wrote: > >>>> > >>>>> I want to know in the following situation, how zookeeper promise > client > >>>>> FIFO order. > >>>>> > >>>>> the client sent three operation to server, set a =3D 1, set b =3D 1= , set > >> ready > >>>>> =3D true. > >>>>> > >>>>> is it possible to this situation that the set a =3D 1 is process by= the > >>>>> leader, then there is something wrong with this tcp connection, thi= s > >> client > >>>>> reconnect a new tcp connection to the leader, but the set b =3D 1 > >> operation > >>>>> is on the way. then the client will use the new tcp connection to > sent > >> set > >>>>> ready =3D true operation. so the set a =3D 1 is operated, set b =3D= 1 is > not > >> and > >>>>> set ready =3D true is operated too. > >>>>> > >>>>> the question is how zab promise client FIFO order? > >>>>> > >>>>> zab can resend all the operation that hasn't be replied from the > >> leader. > >>>>> then in this situation, when the client reconnect to the leader, it > >> will > >>>>> resent the operation set b =3D 1, set ready =3D true. > >>>>> > >>>>> is this the way the zab used to primise FIFO order? > >>>>> > >>>>> Thank you all > >>>>> > >>>>> -- > >>>>> --- > >>>>> Blog: http://www.chenzongzhi.info > >>>>> Twitter: https://twitter.com/baotiao baotiao > >>> > >>>>> Git: https://github.com/baotiao > >>>>> > >> > >> > > --f403045c82041cd62f055df4437d--