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 EC039175B9 for ; Wed, 1 Oct 2014 16:54:39 +0000 (UTC) Received: (qmail 77610 invoked by uid 500); 1 Oct 2014 16:54:39 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 77561 invoked by uid 500); 1 Oct 2014 16:54:39 -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 77546 invoked by uid 99); 1 Oct 2014 16:54:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2014 16:54:38 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tivv00@gmail.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vc0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2014 16:54:12 +0000 Received: by mail-vc0-f172.google.com with SMTP id lf12so563859vcb.3 for ; Wed, 01 Oct 2014 09:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=zKcoxvUPBvmpY65ts5FStlbjm3GvQhaIwgsuOaBtcbY=; b=ttFjcCaIHMqXMZJG7TcvitkqiYY/k2P+HBnS44Cs6h/6wY/tJaOxD6qAmsYlG7Y9I5 xSS2QTzASXLERhb17uH2HWLTgH3xZG3BxTEkUwAVqsLUTBw9V8UlKPyZTJwh0Jp3ck2g H3eQOfVMabv2bz+Q6PClKC4fgyeu+Zkzr6eOp4eXAbS5FcV/0zcgKTfXluuFkJHmkXTM eccA7HEYLHwTYaJUJTsKMyPv5lPt73959kopUVEB2Ur3cC+iJnBap6uUt+/kzKkucZEj LHuDvVo7Len0efrTH/oavl6kx5BfUR+da1aDL33ggONTZjxgzSeUQ4fxWslpZOcNEQCM T+Ow== MIME-Version: 1.0 X-Received: by 10.220.206.196 with SMTP id fv4mr2634865vcb.66.1412182450560; Wed, 01 Oct 2014 09:54:10 -0700 (PDT) Sender: tivv00@gmail.com Received: by 10.220.116.145 with HTTP; Wed, 1 Oct 2014 09:54:10 -0700 (PDT) Received: by 10.220.116.145 with HTTP; Wed, 1 Oct 2014 09:54:10 -0700 (PDT) In-Reply-To: References: Date: Wed, 1 Oct 2014 12:54:10 -0400 X-Google-Sender-Auth: qLsGdk6Ikw5dz1kMmG-TmOBaR0I Message-ID: Subject: Re: very strange behavior - data is not written in ZK From: Vitalii Tymchyshyn To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001a11c2d05e52e53a05045f5944 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2d05e52e53a05045f5944 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Do you see "returning success" printed? If not, what is the return code? 29 =D0=B2=D0=B5=D1=80. 2014 11:14, =D0=BA=D0=BE=D1=80=D0=B8=D1=81=D1=82=D1= =83=D0=B2=D0=B0=D1=87 "Mudit Verma" =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=B2: > Hi, > > I have following function which sets a value to a znode as 1 or 0. Howeve= r, > the value is not getting set in Zookeeper ( data version is being changed > though). This piece of code used to work, until I upgraded the cluster to > latest zookeeper version. > > Any idea what is going wrong? Your help is much appreciated !! > > zk_map_status > > *zk_map_lock(zk_map *zkm) { * > > struct Stat *stats =3D (struct Stat *)xcalloc(1,sizeof(struct Stat)); > > int lock, size; > > *int rc,zrc =3D zoo_get(zkm->zk, zkm->path, 0, (char *)&lock, > &size,stats); * /*/getting the lock value from ZK* > > if(zrc =3D=3DZOK) { > > //here we need to grab the lock > > if(lock =3D=3D 0) { > > printf("\n zk_map_lock %s lock:%d version:%d" > ,zkm->path,lock,stats->version);fflush(stdout); > > lock=3D1; > > int zrc2 =3D *zoo_set(zkm->zk, zkm->path,(char *)&lock, > sizeof(int),stats->version); //if zero setting to 1* > > if(zrc2 =3D=3D ZOK){ > > printf("\n Returning Success");fflush(stdout); > > rc =3D ZK_MAP_SUCCESS; > > } else > > rc =3D ZK_MAP_FAILURE; > > } > > else > > rc =3D ZK_MAP_FAILURE; > > > } > > else if(zrc =3D=3D ZNONODE) > > rc =3D ZK_MAP_ENOENT; > > else > > rc =3D ZK_MAP_FAILURE; > > > //testing need to be removed later on > > lock=3D0; > > *zrc =3D zoo_get(zkm->zk, zkm->path, 0, (char *)&lock, &size,stats); > //retrieving the value and it is still 0 -->very strange* > > printf("\n zrc:%d zk_map_lock %s lock:%d version:%d" > ,zrc,zkm->path,lock,stats->version);fflush(stdout); > > > free(stats); > > return rc; > > > } > > =3D=3D=3D=3D=3D=3D=3D > > output > > *Printf1: zk_map_lock /dir/6549211657075368907 lock:0 version:0* > > *Printf2: zrc:0 zk_map_lock /dir/6549211657075368907 lock:0 version:1* > > > > Thanks, Mudit > --001a11c2d05e52e53a05045f5944--