Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 69382 invoked from network); 30 Dec 2010 17:13:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Dec 2010 17:13:08 -0000 Received: (qmail 48510 invoked by uid 500); 30 Dec 2010 17:13:06 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 48457 invoked by uid 500); 30 Dec 2010 17:13:06 -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 48449 invoked by uid 99); 30 Dec 2010 17:13:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Dec 2010 17:13:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.216.179] (HELO mail-qy0-f179.google.com) (209.85.216.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Dec 2010 17:13:00 +0000 Received: by qyj19 with SMTP id 19so12028152qyj.10 for ; Thu, 30 Dec 2010 09:12:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.212.5 with SMTP id gq5mr14610414qcb.64.1293729157896; Thu, 30 Dec 2010 09:12:37 -0800 (PST) Received: by 10.229.84.198 with HTTP; Thu, 30 Dec 2010 09:12:37 -0800 (PST) X-Originating-IP: [64.132.24.248] In-Reply-To: <45392C0F-3494-4EE7-9E94-A72335BE1DF7@apple.com> References: <81485CA5-0B5A-4D74-9556-7A64C10EF7BB@apple.com> <45392C0F-3494-4EE7-9E94-A72335BE1DF7@apple.com> Date: Thu, 30 Dec 2010 11:12:37 -0600 Message-ID: Subject: Re: can't re-insert row after deleting it? From: Nate McCall To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Extend your code to explicitly set the timestamp on the Column in micro seconds. I think you are just defaulting to 0 and hitting the condition previously described. On Thu, Dec 30, 2010 at 11:02 AM, mike dooley wrote: > hmm, i added a sleep(1000) between each operation and still see the same > behavior. > but stranger still, if i do the exact same operations via the command lin= e > they work > as expected. =A0and the logs for the two runs look identical to me (aside= from > the different keys) > -mike > > ----------------------------------- > [default@unknown] use Harvest; > Authenticated to keyspace: Harvest > [default@Harvest] > [default@Harvest] set Test1['row-c1']['dummy-col'] =3D 'value-a'; > Value inserted. > [default@Harvest] get Test1['row-c1']['dummy-col']; > =3D> (column=3Ddummy-col, value=3D76616c75652d61, timestamp=3D12937274998= 67000) > [default@Harvest] > [default@Harvest] del Test1['row-c1']; > row removed. > [default@Harvest] get Test1['row-c1']['dummy-col']; > Value was not found > [default@Harvest] > [default@Harvest] set Test1['row-c1']['dummy-col'] =3D 'value-a'; > Value inserted. > [default@Harvest] get Test1['row-c1']['dummy-col']; > =3D> (column=3Ddummy-col, value=3D76616c75652d61, timestamp=3D12937274999= 12000) > DEBUG 08:44:59,872 insert > DEBUG 08:44:59,876 insert writing local RowMutation(keyspace=3D'Harvest', > key=3D'726f772d6331', modifications=3D[Test1]) > DEBUG 08:44:59,882 applying mutation of row 726f772d6331 > DEBUG 08:44:59,892 get > DEBUG 08:44:59,893 Sorted endpoints are localhost/127.0.0.1 > DEBUG 08:44:59,893 weakread reading SliceByNamesReadCommand(table=3D'Harv= est', > key=3D726f772d6331, columnParent=3D'QueryPath(columnFamilyName=3D'Test1', > superColumnName=3D'null', columnName=3D'null')', columns=3D[dummy-col,]) = locally > DEBUG 08:44:59,894 weakreadlocal reading > SliceByNamesReadCommand(table=3D'Harvest', key=3D726f772d6331, > columnParent=3D'QueryPath(columnFamilyName=3D'Test1', superColumnName=3D'= null', > columnName=3D'null')', columns=3D[dummy-col,]) > DEBUG 08:44:59,903 remove > DEBUG 08:44:59,903 insert writing local RowMutation(keyspace=3D'Harvest', > key=3D'726f772d6331', modifications=3D[Test1]) > DEBUG 08:44:59,904 applying mutation of row 726f772d6331 > DEBUG 08:44:59,908 get > DEBUG 08:44:59,908 Sorted endpoints are localhost/127.0.0.1 > DEBUG 08:44:59,909 weakread reading SliceByNamesReadCommand(table=3D'Harv= est', > key=3D726f772d6331, columnParent=3D'QueryPath(columnFamilyName=3D'Test1', > superColumnName=3D'null', columnName=3D'null')', columns=3D[dummy-col,]) = locally > DEBUG 08:44:59,909 weakreadlocal reading > SliceByNamesReadCommand(table=3D'Harvest', key=3D726f772d6331, > columnParent=3D'QueryPath(columnFamilyName=3D'Test1', superColumnName=3D'= null', > columnName=3D'null')', columns=3D[dummy-col,]) > DEBUG 08:44:59,912 insert > DEBUG 08:44:59,913 insert writing local RowMutation(keyspace=3D'Harvest', > key=3D'726f772d6331', modifications=3D[Test1]) > DEBUG 08:44:59,913 applying mutation of row 726f772d6331 > DEBUG 08:44:59,919 get > DEBUG 08:44:59,919 Sorted endpoints are localhost/127.0.0.1 > DEBUG 08:44:59,919 weakread reading SliceByNamesReadCommand(table=3D'Harv= est', > key=3D726f772d6331, columnParent=3D'QueryPath(columnFamilyName=3D'Test1', > superColumnName=3D'null', columnName=3D'null')', columns=3D[dummy-col,]) = locally > DEBUG 08:44:59,920 weakreadlocal reading > SliceByNamesReadCommand(table=3D'Harvest', key=3D726f772d6331, > columnParent=3D'QueryPath(columnFamilyName=3D'Test1', superColumnName=3D'= null', > columnName=3D'null')', columns=3D[dummy-col,]) > ------------------ > =3D=3D=3D starting > =3D=3D=3D inserting row: row-j1, value: value-a > =3D=3D=3D about to retrieve data > =3D=3D=3D got (dummy-col,value-a) > =3D=3D=3D deleting row: row-j1 > =3D=3D=3D data not found, as expected > =3D=3D=3D re-inserting row: row-j1 > =3D=3D=3D !!!! re-inserted data not found > =3D=3D=3D crush all boxes > DEBUG 08:46:20,131 insert > DEBUG 08:46:20,132 insert writing local RowMutation(keyspace=3D'Harvest', > key=3D'726f772d6a31', modifications=3D[Test1]) > DEBUG 08:46:20,133 applying mutation of row 726f772d6a31 > DEBUG 08:46:20,144 get > DEBUG 08:46:20,144 Sorted endpoints are localhost/127.0.0.1 > DEBUG 08:46:20,145 weakread reading SliceByNamesReadCommand(table=3D'Harv= est', > key=3D726f772d6a31, columnParent=3D'QueryPath(columnFamilyName=3D'Test1', > superColumnName=3D'null', columnName=3D'null')', columns=3D[dummy-col,]) = locally > DEBUG 08:46:20,145 weakreadlocal reading > SliceByNamesReadCommand(table=3D'Harvest', key=3D726f772d6a31, > columnParent=3D'QueryPath(columnFamilyName=3D'Test1', superColumnName=3D'= null', > columnName=3D'null')', columns=3D[dummy-col,]) > DEBUG 08:46:21,156 remove > DEBUG 08:46:21,157 insert writing local RowMutation(keyspace=3D'Harvest', > key=3D'726f772d6a31', modifications=3D[Test1]) > DEBUG 08:46:21,157 applying mutation of row 726f772d6a31 > DEBUG 08:46:21,160 get > DEBUG 08:46:21,161 Sorted endpoints are localhost/127.0.0.1 > DEBUG 08:46:21,161 weakread reading SliceByNamesReadCommand(table=3D'Harv= est', > key=3D726f772d6a31, columnParent=3D'QueryPath(columnFamilyName=3D'Test1', > superColumnName=3D'null', columnName=3D'null')', columns=3D[dummy-col,]) = locally > DEBUG 08:46:21,161 weakreadlocal reading > SliceByNamesReadCommand(table=3D'Harvest', key=3D726f772d6a31, > columnParent=3D'QueryPath(columnFamilyName=3D'Test1', superColumnName=3D'= null', > columnName=3D'null')', columns=3D[dummy-col,]) > DEBUG 08:46:22,164 insert > DEBUG 08:46:22,167 insert writing local RowMutation(keyspace=3D'Harvest', > key=3D'726f772d6a31', modifications=3D[Test1]) > DEBUG 08:46:22,167 applying mutation of row 726f772d6a31 > DEBUG 08:46:22,168 get > DEBUG 08:46:22,169 Sorted endpoints are localhost/127.0.0.1 > DEBUG 08:46:22,169 weakread reading SliceByNamesReadCommand(table=3D'Harv= est', > key=3D726f772d6a31, columnParent=3D'QueryPath(columnFamilyName=3D'Test1', > superColumnName=3D'null', columnName=3D'null')', columns=3D[dummy-col,]) = locally > DEBUG 08:46:22,169 weakreadlocal reading > SliceByNamesReadCommand(table=3D'Harvest', key=3D726f772d6a31, > columnParent=3D'QueryPath(columnFamilyName=3D'Test1', superColumnName=3D'= null', > columnName=3D'null')', columns=3D[dummy-col,]) > > On Dec 29, 2010, at 8:27 PM, Jonathan Ellis wrote: > > deletes "win" races, so if 3) happens at the same timestamp as 2) then > the delete takes precedence. > > On Wed, Dec 29, 2010 at 9:58 PM, mike dooley wrote: > > sorry, i forgot to mention that i am using 0.7-rc2 > > On Dec 29, 2010, at 7:56 PM, mike dooley wrote: > > things have not been going very well for me today, so maybe there's > something > > that i'm missing, but here is a little test program that just: > > 1) inserts a single column in a row, > > 2) deletes the row, > > 3) re-inserts the row > > but it seems that the second insert fails to actually insert the data. he= re > is the output > > of the test program > > =3D=3D=3D starting > > =3D=3D=3D inserting row: row-a, value: value-a > > =3D=3D=3D about to retrieve data > > =3D=3D=3D got (dummy-col,value-a) > > =3D=3D=3D deleting row: row-a > > =3D=3D=3D data not found, as expected > > =3D=3D=3D re-inserting row: row-a > > =3D=3D=3D !!!! re-inserted data not found > > =3D=3D=3D crush all boxes > > and subsequent inserts also fail (if you run the program again). > > here is the test program > > > > i am just using a single node, with the following schema > > =A0create keyspace Harvest with replication_factor =3D 1 and placement_st= rategy > =3D 'org.apache.cassandra.locator.SimpleStrategy'; > > =A0use Harvest; > > =A0create column family Test1 with column_type =3D 'Standard' and compara= tor =3D > 'UTF8Type'; > > thanks in advance. > > -mike > > > > > > -- > Jonathan Ellis > Project Chair, Apache Cassandra > co-founder of Riptano, the source for professional Cassandra support > http://riptano.com > >