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 2176318CE0 for ; Fri, 2 Oct 2015 17:07:14 +0000 (UTC) Received: (qmail 60699 invoked by uid 500); 2 Oct 2015 17:07:13 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 60655 invoked by uid 500); 2 Oct 2015 17:07:13 -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 60641 invoked by uid 99); 2 Oct 2015 17:07:13 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2015 17:07:13 +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 8C55DC17A9 for ; Fri, 2 Oct 2015 17:07:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.98 X-Spam-Level: ** X-Spam-Status: No, score=2.98 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id NzfJqXQeg6BQ for ; Fri, 2 Oct 2015 17:07:06 +0000 (UTC) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id AAAC120592 for ; Fri, 2 Oct 2015 17:07:05 +0000 (UTC) Received: by obcgx8 with SMTP id gx8so86508479obc.3 for ; Fri, 02 Oct 2015 10:06:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=oFrfgG/D0CIZqKrqvnKGYUaYHSRiiXXrl+e7bUsNzU0=; b=VryDyKfy5GJkp1niU7vbvDtL3nYIYkkShqmoGCxak2rJgZSQD5X6JLdB3NE8mmC3O0 neWLRk4VPBQ9hTyI0y48Fl55kt7EoPlLOUcE4krivgntjLhovckk1sfnM/Lcpj0ouD8d 4fFWYjR/1vUAXpldO3MCqoXggeMniQ5hKt3mXB6bIxx4hI17p3jhNJ1tFZLahPkit/oa 0When+apJSgz2N7gXnEIE9xv8ovz4XakhjKg4Mgon1PGFNvlDNztyUZPBz+aa/i9FU8X 7RJB+EaAlCcT+/Fl0QTOotd28PCuXhL6JRwAHaTrSJGkOzORtekq9O3Z142kkMW6zccW FOCQ== X-Gm-Message-State: ALoCoQnpsvdsx5rSUHP2p+V7Oq6Apus4AmDP5TB0kyLGA7YbT4xCLV8VjoGtEAj/fCPNho0NU/3LIet9ZvNepdhGG4OWSo5jtNs/h62hwWjeZV8zAdODzE19m9TOZsldusONjF8qr+VrteDgKH3k55Wx4pwq8zEosy/NFzjZHWl+4R3FS5WCm6G6w994dcqTbKrkSmHTDOHRJhLsYLH09RKdls83G/q7Zw== MIME-Version: 1.0 X-Received: by 10.60.176.37 with SMTP id cf5mr9840859oec.19.1443805618316; Fri, 02 Oct 2015 10:06:58 -0700 (PDT) Received: by 10.202.87.212 with HTTP; Fri, 2 Oct 2015 10:06:58 -0700 (PDT) In-Reply-To: References: Date: Fri, 2 Oct 2015 10:06:58 -0700 Message-ID: Subject: Re: Can a CRUD operation succeed when we have a ConnectionLossException? From: Benjamin Jaton To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=089e0117627d01483c052122315e --089e0117627d01483c052122315e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you, I appreciate the feedback. On Fri, Oct 2, 2015 at 10:01 AM, Ra=C3=BAl Guti=C3=A9rrez Segal=C3=A9s wrote: > On 2 October 2015 at 09:48, Benjamin Jaton > wrote: > > > Hi, > > > > In a small test class I keep creating/deleting the same node /test. > > > > I kill (Ctrl+C) and restart the ZK server in the command line randomly. > > > > After a couple attempts here is what we get: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *Fri Oct 02 09:27:23 PDT 2015 - Deleting /testFri Oct 02 09:27:23 PDT > 2015 > > - /test has been deleted.Fri Oct 02 09:27:23 PDT 2015 - Node /test has > > successfully been removed.Fri Oct 02 09:27:23 PDT 2015 - Recreating > > /testFri Oct 02 09:27:23 PDT 2015 - CONN LOST on createFri Oct 02 > 09:27:24 > > PDT 2015 - ERROR: node should be removed.Fri Oct 02 09:27:24 PDT 2015 - > > Data of node is: testNode has been mysteriously > > created...org.apache.zookeeper.KeeperException$NodeExistsException: > > KeeperErrorCode =3D NodeExists for /test at > > org.apache.zookeeper.KeeperException.create(KeeperException.java:123) > at > > org.apache.zookeeper.KeeperException.create(KeeperException.java:51) > at > > org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1209) at > > TestZKSaveConnLoss.create(TestZKSaveConnLoss.java:101) at > > TestZKSaveConnLoss.access$4(TestZKSaveConnLoss.java:98) at > > TestZKSaveConnLoss$2.run(TestZKSaveConnLoss.java:56)* > > > > The 1st create fails with a ConnectionLossException. > > When we retry to create the node, we get a NodeExistsException. > > > > So the node got created despite the ConnectionLossException. > > The same thing happens with the delete operation. > > > > I was wondering if this is an known/expected behavior and how people de= al > > with it? > > > > It's totally legit. Say you have: > > client> sends create /foo > server> receives receives requests and fwds to the leader > server> is about to reply that the create happened > ... RSTs are injected and socket goes away ... > client> sees ConnectionLoss > > The way the client would deal with this is by calling exists() on the nod= es > it cares about, after recovering > from ConnectionLoss. > > > -rgs > --089e0117627d01483c052122315e--