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 E6C70101DD for ; Wed, 20 Nov 2013 07:02:14 +0000 (UTC) Received: (qmail 69951 invoked by uid 500); 20 Nov 2013 07:02:14 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 69720 invoked by uid 500); 20 Nov 2013 07:02:10 -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 69710 invoked by uid 99); 20 Nov 2013 07:02:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Nov 2013 07:02:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of german.blanco.blanco@gmail.com designates 74.125.82.46 as permitted sender) Received: from [74.125.82.46] (HELO mail-wg0-f46.google.com) (74.125.82.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Nov 2013 07:02:01 +0000 Received: by mail-wg0-f46.google.com with SMTP id x12so8681610wgg.25 for ; Tue, 19 Nov 2013 23:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/utXM0td6SGQND7XKtfS6T5cjZXG7SAoxQAEhvPE5zA=; b=R8JZa3RVOVO8wOIpGCZQsP5QTKsBaEsJ1KKlnSY+Bav5eNrfqpjhNeS5iu8opKd2vd RV+zf5g4S888KbZEEraGAYdWFF8XZOKYPd8eULIeFZQWRzps+BujVv8wE0mYBC9hF+4E VzUHr0Acy2512ioA9IZBpdbSqKXrx1cMca8xFyPwGJnGWf5+Nke6+q/bb7ho0/JnJskT 7DBnyN4P9BWnTUcXxugYuT5D3YSOv+sfArIuE/lmpwi5VFgQiML6izcTUbpZCjiyBIlF 1UAk8KWxANkEx/E+epwFGU+HERd/pIVO/0Btk/mitOI0GOTfibxhpLZ/dera/c9hEU4B KPNw== MIME-Version: 1.0 X-Received: by 10.194.93.105 with SMTP id ct9mr24612907wjb.6.1384930901489; Tue, 19 Nov 2013 23:01:41 -0800 (PST) Received: by 10.217.103.199 with HTTP; Tue, 19 Nov 2013 23:01:41 -0800 (PST) In-Reply-To: References: Date: Wed, 20 Nov 2013 08:01:41 +0100 Message-ID: Subject: Re: zookeeper client session write-read consistency From: German Blanco To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=047d7bb03e786bfb0b04eb965a71 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bb03e786bfb0b04eb965a71 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable hello, I believe that if you observe that, you should try to reproduce it with TRACE logging level and open a JIRA with the case sending the logs. If I am not wrong, ZooKeeper transactions are guaranteed to be executed in sequential order in all servers and within the client session. This means that if a client sends a write, AND no other client modifies that information, it will always see the result of that write in any subsequent read. This is true regardless of whether the client connects to one single server or needs to reconnect to another server of the quorum. The session may be kept when reconnecting, but the server checks that the last zxid seen by the client has also been seen by the server before allowing the connection. That means that if the client has made a write within that session, the server will only allow the connection if the write is included in the server's transaction log. As you say, reads are not necessarily consistent, but that applies only to different sessions connected to different servers. This is at least my view on your issue. /Germ=E1n. On Tue, Nov 19, 2013 at 9:51 PM, Mohammad Shamma wrote: > I have a question about the consistency guarantees of zookeeper. > > As far as I understand, zookeeper provides eventual consistency guarantee= s. > Updates are not guaranteed to be seen by read operations following an > update (reads are not necessarily consistent). The reason behind this is > that reads might be served by a server that was not part of the quorum th= at > approved of an update (and the server serving the read has not yet receiv= ed > the update). > > I have observed such write/read inconsistencies on operations within the > same client session. Is this behavior expected? This write/read > inconsistency is expected when the read and write are dispatched to > different servers, however it seems a bit odd that writes and reads that > are dispatched against the same server would be inconsistent. > > -- > Mohammad Shamma > --047d7bb03e786bfb0b04eb965a71--