Return-Path: Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: (qmail 28309 invoked from network); 18 Jan 2011 17:12:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jan 2011 17:12:32 -0000 Received: (qmail 83031 invoked by uid 500); 18 Jan 2011 17:12:30 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 82849 invoked by uid 500); 18 Jan 2011 17:12:29 -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 82840 invoked by uid 99); 18 Jan 2011 17:12:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jan 2011 17:12:28 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ted.dunning@gmail.com designates 209.85.212.42 as permitted sender) Received: from [209.85.212.42] (HELO mail-vw0-f42.google.com) (209.85.212.42) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jan 2011 17:12:21 +0000 Received: by vws11 with SMTP id 11so2603785vws.15 for ; Tue, 18 Jan 2011 09:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=eGkQP9Um4fgbbB7Y54i5hy1b526IdMR39An3wB053xg=; b=U229VtEuCphJsPp7HBPw2QOnl/D/vIuuwMjxrMyuqMf4DIkK6e9uiVjDmiDoQMQVnu p9x1HlLTV9PxjGkaQKzc/Zx/vN9GHfiqZbDem8QHAebHXNeNpXGkddvqpG+99zHqVEix KDfnI8I6M/kpltUdabBWynVXjswOVFepl8x48= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Bjj7ZSKeeBGNIGRDiBkqjxUUi6bnxmvqduInU8pIcAICc6PNAit/6g+ygBFp/m03Uk BUfPlb7btUr32H0Vv83MBSdXUhfDWLN3OY8BGt+A7Wnv2NAjx4mjbYzd/WQs95XSTwxP VRcC/mWmwchrtdNu2cytEAZZNCh/SE1VZZJF0= Received: by 10.229.87.75 with SMTP id v11mr5025529qcl.183.1295370718260; Tue, 18 Jan 2011 09:11:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.71.147 with HTTP; Tue, 18 Jan 2011 09:11:38 -0800 (PST) In-Reply-To: <4D35D4F4.8060103@yahoo-inc.com> References: <4D35D4F4.8060103@yahoo-inc.com> From: Ted Dunning Date: Tue, 18 Jan 2011 09:11:38 -0800 Message-ID: Subject: Re: Atomic Compare-and-swap like operations To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=0016364ef32083be75049a21ff84 X-Virus-Checked: Checked by ClamAV on apache.org --0016364ef32083be75049a21ff84 Content-Type: text/plain; charset=UTF-8 Regarding multi, I have the request and responses all set up on the client and server side and have a test that sends a multi request to the server. The server falls over at that point (of course) because it doesn't know how to handle that request type. My problem at this point is that there isn't much of a roadmap for where the response actually needs to be handled. Right now my test fails pretty late in the processing because the response header is never set up. Can somebody point me to the classes that actually need to handle the multi request? (for the non-insiders, the confusion arises because of the way the server is modularized. Steps in the processing are arranged in a pipeline, each of which handles one distinct aspect of the process. These steps are arranged differently on a slave, on the master and on a stand-alone server. Having the steps arranged differently allows the steps to be re-used for these different kinds of server. That does make changing the server a bit more complex, though since some steps forward some request but not others and other steps handle some requests and not others. Finding all the places to change can be tricky to do right if you don't know the code. I don't know the code) On Tue, Jan 18, 2011 at 9:59 AM, Benjamin Reed wrote: > it would be nice if it could be folded in, it does create a problem though. > the issue is that only reads do not go through the atomic broadcast, so in > some recovery cases it would be hard to get the old data back. it's not that > in can't be done, but i think it significantly complicates the design. > > it seems like the easiest way to do this would be to have the > delete-and-return operation so that the old data is explicitly put in the > recovery log. if we do delete-and-return, we probably also want > set-and-return :) > > ben > > > On 01/15/2011 01:43 PM, Ted Dunning wrote: > >> I think that the multi stuff is the ideal place for this kind of >> capability. >> To do this, we would need to add a get operation to the current >> collection. >> I think that would be an excellent addition, not only for your use case >> but >> also the one where you want to get consistent copies of several znodes at >> once. >> >> On Sat, Jan 15, 2011 at 8:14 AM, Scott Fines >> wrote: >> >> It seems like it would be a very powerful option to be able to have a >>> "delete-and-return" operation that atomically deletes a znode, and >>> returns >>> the bytes that were previously stored in that znode. Is there a >>> particular >>> reason why this was not chosen as the behavior of the API? In most of the >>> other generic compare-and-swap operations (put-if-absent and >>> set-if-matches), there is already a mechanism in place, or one can >>> relatively easily be implemented, but this seems like an odd oversight. >>> >>> I saw that ZooKeeper-965< >>> https://issues.apache.org/jira/browse/ZOOKEEPER-965> >>> could >>> potentially address this in the future, but it seems like API overkill >>> for >>> something like this. >>> >>> > --0016364ef32083be75049a21ff84--