Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 65386 invoked from network); 25 Mar 2010 20:45:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Mar 2010 20:45:33 -0000 Received: (qmail 86169 invoked by uid 500); 25 Mar 2010 20:45:32 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 86148 invoked by uid 500); 25 Mar 2010 20:45:32 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 86136 invoked by uid 99); 25 Mar 2010 20:45:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 20:45:32 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 20:45:26 +0000 Received: by wyb29 with SMTP id 29so3671898wyb.31 for ; Thu, 25 Mar 2010 13:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=9yp9QTg3tVP4S82tvfJq/fUcQ1hrFH8YMYy7w/wJw+8=; b=sJSkhDUp3gsPV3YVjnVXcnsCNPMH0ekchbGDwunq5nEh+IYJHfoxJk0o8I2jv3p2EY s2DnIefiVG9X3BhSG+4uqwP8HkyoE2+1F0GFpQQiBqcmKq3n2/O1gJ+wkPaf6aWTW3gT GyT5fbvkkVvO+9GSUALedQna88yvUQMi74XsQ= 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:content-transfer-encoding; b=KsGS82Z3Opip+iVaUJfwXVc0yma+2yIacA1hd8l2mLPy74//AulxsgoK8xHgdZvxB+ fPvNv5lWrKIbeOSEQxXs1W4hNynJZSBV1eD9e+uT+/2FAfZ77sTP4DmSc1R4u2iLgi4+ pUCngPt6bkcXQVn5LgMSyA8ID1bQjOt4uXk84= MIME-Version: 1.0 Received: by 10.216.88.212 with SMTP id a62mr1752525wef.72.1269549905563; Thu, 25 Mar 2010 13:45:05 -0700 (PDT) In-Reply-To: <89804a1c1003251339p54a8f4w58763360d2e5c39c@mail.gmail.com> References: <89804a1c1003221513h1843c3e6vac6f04168c5592f8@mail.gmail.com> <89804a1c1003251339p54a8f4w58763360d2e5c39c@mail.gmail.com> From: Jonathan Ellis Date: Thu, 25 Mar 2010 15:44:45 -0500 Message-ID: Subject: Re: Deleting and re-inserting row causes error in get_slice count parameter To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Can you create a ticket with a test case? On Thu, Mar 25, 2010 at 3:39 PM, Bob Florian wrote: > I was originally using 0.5.0 but I've reproduced the behavior with > 0.5.1 and 0.6.0-beta3. > > > On Wed, Mar 24, 2010 at 3:00 PM, Jonathan Ellis wrote= : >> Are you using 0.5.0? =A0Because this sounds like a bug that was fixed in= 0.5.1. >> >> On Mon, Mar 22, 2010 at 5:13 PM, Bob Florian wrote: >>> I'm new to Cassandra and have run into a problem that I think is a >>> bug, but wanted to get some feedback in case I'm misunderstanding >>> something. >>> >>> I've found that when I delete an entire row in a column family with >>> super columns, and then re-insert values with the same row and super >>> column keys, the count parameter to the get_slice call no longer works >>> properly.=A0 Its like it is still counting the deleted columns, but onl= y >>> returning the new columns. >>> >>> The following example uses the Ruby Cassandra client (see link below), >>> but I've seen the same behavior with the Java Thrift interface. >>> >>> 1) =A0First I create a client and insert a super column with three colu= mns: >>> >>>>> require 'cassandra' >>> =3D> true >>>>> cc =3D Cassandra.new('Keyspace1') >>> =3D> #>> @servers=3D["127.0.0.1:9160"]> >>>>> cc.insert(:Super1,'test1',{'bucket1' =3D> {'1' =3D> 'Item 1', '2' =3D= > 'Item 2', '5' =3D> 'Item 5'}}) >>> =3D> nil >>> >>> >>> 2) =A0Getting the slice of columns just inserted works with or without >>> the count parameter: >>> >>>>> cc.get(:Super1,'test1','bucket1') >>> =3D> #"Item 1", "2"=3D>"Item 2", "5"=3D>"Item 5"}> >>> >>>>> cc.get(:Super1,'test1','bucket1',:count =3D> 3) >>> =3D> #"Item 1", "2"=3D>"Item 2", "5"=3D>"Item 5"}> >>> >>> >>> 3) =A0Now I remove the row: >>> >>>>> cc.remove(:Super1,'test1') >>> =3D> nil >>> >>> >>> 4) =A0And confirm that nothing's left: >>>>> cc.get(:Super1,'test1','bucket1') >>> =3D> # >>> >>> >>> 5) =A0Next I insert 3 different columns using the same row and super co= lumn keys: >>> >>>>> cc.insert(:Super1,'test1',{'bucket1' =3D> {'3' =3D> 'Item 3', '4' =3D= > 'Item 4', '6' =3D> 'Item 6'}}) >>> =3D> nil >>> >>> >>> 6) =A0Getting the slice of columns works correctly with no count parame= ter: >>> >>>>> cc.get(:Super1,'test1','bucket1') >>> =3D> #"Item 6", "3"=3D>"Item 3", "4"=3D>"Item 4"}> >>> >>> >>> 7) =A0But setting the count parameter to 3 returns fewer than 3 columns= : >>> >>>>> cc.get(:Super1,'test1','bucket1',:count =3D> 3) >>> =3D> #"Item 3"}> >>> >>> >>> 8) =A0Incrementally increasing the count parameter confirms the apparen= t >>> behavior of counting the deleted columns: >>> >>>>> cc.get(:Super1,'test1','bucket1',:count =3D> 4) >>> =3D> #"Item 3", "4"=3D>"Item 4"}> >>>>> cc.get(:Super1,'test1','bucket1',:count =3D> 5) >>> =3D> #"Item 3", "4"=3D>"Item 4"}> >>> >>> >>> 9) I have to set the count to 6 to return all 3 columns: >>> >>>>> cc.get(:Super1,'test1','bucket1',:count =3D> 6) >>> =3D> #"Item 6", "3"=3D>"Item 3", "4"=3D>"Item 4"}> >>> >>> >>> The same thing doesn't happen when I remove only the super column key >>> ('bucket1'). >>> >>> Here's the reference to the Ruby client I used for the example, but >>> the problem is not client specific. >>> http://blog.evanweaver.com/files/doc/fauna/cassandra/files/README_rdoc.= html >>> >> >