You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by mike dooley <do...@apple.com> on 2010/12/30 04:56:49 UTC

can't re-insert row after deleting it?

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. here is the output
of the test program

=== starting
=== inserting row: row-a, value: value-a
=== about to retrieve data
=== got (dummy-col,value-a)
=== deleting row: row-a
=== data not found, as expected
=== re-inserting row: row-a
=== !!!! re-inserted data not found
=== crush all boxes

and subsequent inserts also fail (if you run the program again).

here is the test program


Re: can't re-insert row after deleting it?

Posted by Javier Canillas <ja...@gmail.com>.
As Jonathan has told you, Please double check the Timestamp of the column
you are adding the second time. Probably this timestamp is smaller (or
lowerer) than the timestamp given when the deletion happens.

On Thu, Dec 30, 2010 at 1:27 AM, Jonathan Ellis <jb...@gmail.com> 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 <do...@apple.com> 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.
> here is the output
> >> of the test program
> >>
> >> === starting
> >> === inserting row: row-a, value: value-a
> >> === about to retrieve data
> >> === got (dummy-col,value-a)
> >> === deleting row: row-a
> >> === data not found, as expected
> >> === re-inserting row: row-a
> >> === !!!! re-inserted data not found
> >> === crush all boxes
> >>
> >> and subsequent inserts also fail (if you run the program again).
> >>
> >> here is the test program
> >>
> >> <CClient.java>
> >>
> >> i am just using a single node, with the following schema
> >>
> >>  create keyspace Harvest with replication_factor = 1 and
> placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
> >>  use Harvest;
> >>  create column family Test1 with column_type = 'Standard' and comparator
> = 'UTF8Type';
> >>
> >> thanks in advance.
> >> -mike
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>

Re: can't re-insert row after deleting it?

Posted by mike dooley <do...@apple.com>.
yes, that was just a test program.  for my real code i'm using pelops.

-mike

On Dec 31, 2010, at 5:52 AM, Peter Schuller wrote:

>> you're right, i wasn't setting the timestamp on my insert.  after fixing
>> that everything works fine.
> 
> In general though, consider using a higher-level client to avoid
> mistakes like these (among other reasons):
> 
>   http://wiki.apache.org/cassandra/ClientOptions
> 
> -- 
> / Peter Schuller


Re: can't re-insert row after deleting it?

Posted by Peter Schuller <pe...@infidyne.com>.
> you're right, i wasn't setting the timestamp on my insert.  after fixing
> that everything works fine.

In general though, consider using a higher-level client to avoid
mistakes like these (among other reasons):

   http://wiki.apache.org/cassandra/ClientOptions

-- 
/ Peter Schuller

Re: can't re-insert row after deleting it?

Posted by mike dooley <do...@apple.com>.
you're right, i wasn't setting the timestamp on my insert.  after fixing that everything works fine.

thanks,
-mike

On Dec 30, 2010, at 11:29 AM, Javier Canillas wrote:

> Yeah, double check your are not using a constant on the timestamp, or the second time you add the same column, such column contains the same timestamp as the first one (that will be smaller than the one put on the delete command).
> 
> Can you share us your code example?
> 
> On Thu, Dec 30, 2010 at 2:12 PM, Nate McCall <na...@riptano.com> wrote:
> 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 <do...@apple.com> 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 line
> > they work
> > as expected.  and 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'] = 'value-a';
> > Value inserted.
> > [default@Harvest] get Test1['row-c1']['dummy-col'];
> > => (column=dummy-col, value=76616c75652d61, timestamp=1293727499867000)
> > [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'] = 'value-a';
> > Value inserted.
> > [default@Harvest] get Test1['row-c1']['dummy-col'];
> > => (column=dummy-col, value=76616c75652d61, timestamp=1293727499912000)
> > DEBUG 08:44:59,872 insert
> > DEBUG 08:44:59,876 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6331', modifications=[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='Harvest',
> > key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> > DEBUG 08:44:59,894 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:44:59,903 remove
> > DEBUG 08:44:59,903 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6331', modifications=[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='Harvest',
> > key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> > DEBUG 08:44:59,909 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:44:59,912 insert
> > DEBUG 08:44:59,913 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6331', modifications=[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='Harvest',
> > key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> > DEBUG 08:44:59,920 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > ------------------
> > === starting
> > === inserting row: row-j1, value: value-a
> > === about to retrieve data
> > === got (dummy-col,value-a)
> > === deleting row: row-j1
> > === data not found, as expected
> > === re-inserting row: row-j1
> > === !!!! re-inserted data not found
> > === crush all boxes
> > DEBUG 08:46:20,131 insert
> > DEBUG 08:46:20,132 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6a31', modifications=[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='Harvest',
> > key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> > DEBUG 08:46:20,145 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:46:21,156 remove
> > DEBUG 08:46:21,157 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6a31', modifications=[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='Harvest',
> > key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> > DEBUG 08:46:21,161 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:46:22,164 insert
> > DEBUG 08:46:22,167 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6a31', modifications=[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='Harvest',
> > key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> > DEBUG 08:46:22,169 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[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 <do...@apple.com> 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. here
> > is the output
> >
> > of the test program
> >
> > === starting
> >
> > === inserting row: row-a, value: value-a
> >
> > === about to retrieve data
> >
> > === got (dummy-col,value-a)
> >
> > === deleting row: row-a
> >
> > === data not found, as expected
> >
> > === re-inserting row: row-a
> >
> > === !!!! re-inserted data not found
> >
> > === crush all boxes
> >
> > and subsequent inserts also fail (if you run the program again).
> >
> > here is the test program
> >
> > <CClient.java>
> >
> > i am just using a single node, with the following schema
> >
> >  create keyspace Harvest with replication_factor = 1 and placement_strategy
> > = 'org.apache.cassandra.locator.SimpleStrategy';
> >
> >  use Harvest;
> >
> >  create column family Test1 with column_type = 'Standard' and comparator =
> > 'UTF8Type';
> >
> > thanks in advance.
> >
> > -mike
> >
> >
> >
> >
> >
> > --
> > Jonathan Ellis
> > Project Chair, Apache Cassandra
> > co-founder of Riptano, the source for professional Cassandra support
> > http://riptano.com
> >
> >
> 


Re: can't re-insert row after deleting it?

Posted by Javier Canillas <ja...@gmail.com>.
Yeah, double check your are not using a constant on the timestamp, or the
second time you add the same column, such column contains the same timestamp
as the first one (that will be smaller than the one put on the delete
command).

Can you share us your code example?

On Thu, Dec 30, 2010 at 2:12 PM, Nate McCall <na...@riptano.com> wrote:

> 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 <do...@apple.com> 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
> line
> > they work
> > as expected.  and 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'] = 'value-a';
> > Value inserted.
> > [default@Harvest] get Test1['row-c1']['dummy-col'];
> > => (column=dummy-col, value=76616c75652d61, timestamp=1293727499867000)
> > [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'] = 'value-a';
> > Value inserted.
> > [default@Harvest] get Test1['row-c1']['dummy-col'];
> > => (column=dummy-col, value=76616c75652d61, timestamp=1293727499912000)
> > DEBUG 08:44:59,872 insert
> > DEBUG 08:44:59,876 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6331', modifications=[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='Harvest',
> > key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,])
> locally
> > DEBUG 08:44:59,894 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:44:59,903 remove
> > DEBUG 08:44:59,903 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6331', modifications=[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='Harvest',
> > key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,])
> locally
> > DEBUG 08:44:59,909 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:44:59,912 insert
> > DEBUG 08:44:59,913 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6331', modifications=[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='Harvest',
> > key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,])
> locally
> > DEBUG 08:44:59,920 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > ------------------
> > === starting
> > === inserting row: row-j1, value: value-a
> > === about to retrieve data
> > === got (dummy-col,value-a)
> > === deleting row: row-j1
> > === data not found, as expected
> > === re-inserting row: row-j1
> > === !!!! re-inserted data not found
> > === crush all boxes
> > DEBUG 08:46:20,131 insert
> > DEBUG 08:46:20,132 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6a31', modifications=[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='Harvest',
> > key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,])
> locally
> > DEBUG 08:46:20,145 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:46:21,156 remove
> > DEBUG 08:46:21,157 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6a31', modifications=[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='Harvest',
> > key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,])
> locally
> > DEBUG 08:46:21,161 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[dummy-col,])
> > DEBUG 08:46:22,164 insert
> > DEBUG 08:46:22,167 insert writing local RowMutation(keyspace='Harvest',
> > key='726f772d6a31', modifications=[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='Harvest',
> > key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> > superColumnName='null', columnName='null')', columns=[dummy-col,])
> locally
> > DEBUG 08:46:22,169 weakreadlocal reading
> > SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> > columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> > columnName='null')', columns=[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 <do...@apple.com> 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.
> here
> > is the output
> >
> > of the test program
> >
> > === starting
> >
> > === inserting row: row-a, value: value-a
> >
> > === about to retrieve data
> >
> > === got (dummy-col,value-a)
> >
> > === deleting row: row-a
> >
> > === data not found, as expected
> >
> > === re-inserting row: row-a
> >
> > === !!!! re-inserted data not found
> >
> > === crush all boxes
> >
> > and subsequent inserts also fail (if you run the program again).
> >
> > here is the test program
> >
> > <CClient.java>
> >
> > i am just using a single node, with the following schema
> >
> >  create keyspace Harvest with replication_factor = 1 and
> placement_strategy
> > = 'org.apache.cassandra.locator.SimpleStrategy';
> >
> >  use Harvest;
> >
> >  create column family Test1 with column_type = 'Standard' and comparator
> =
> > 'UTF8Type';
> >
> > thanks in advance.
> >
> > -mike
> >
> >
> >
> >
> >
> > --
> > Jonathan Ellis
> > Project Chair, Apache Cassandra
> > co-founder of Riptano, the source for professional Cassandra support
> > http://riptano.com
> >
> >
>

Re: can't re-insert row after deleting it?

Posted by Nate McCall <na...@riptano.com>.
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 <do...@apple.com> 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 line
> they work
> as expected.  and 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'] = 'value-a';
> Value inserted.
> [default@Harvest] get Test1['row-c1']['dummy-col'];
> => (column=dummy-col, value=76616c75652d61, timestamp=1293727499867000)
> [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'] = 'value-a';
> Value inserted.
> [default@Harvest] get Test1['row-c1']['dummy-col'];
> => (column=dummy-col, value=76616c75652d61, timestamp=1293727499912000)
> DEBUG 08:44:59,872 insert
> DEBUG 08:44:59,876 insert writing local RowMutation(keyspace='Harvest',
> key='726f772d6331', modifications=[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='Harvest',
> key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> DEBUG 08:44:59,894 weakreadlocal reading
> SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> columnName='null')', columns=[dummy-col,])
> DEBUG 08:44:59,903 remove
> DEBUG 08:44:59,903 insert writing local RowMutation(keyspace='Harvest',
> key='726f772d6331', modifications=[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='Harvest',
> key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> DEBUG 08:44:59,909 weakreadlocal reading
> SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> columnName='null')', columns=[dummy-col,])
> DEBUG 08:44:59,912 insert
> DEBUG 08:44:59,913 insert writing local RowMutation(keyspace='Harvest',
> key='726f772d6331', modifications=[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='Harvest',
> key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1',
> superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> DEBUG 08:44:59,920 weakreadlocal reading
> SliceByNamesReadCommand(table='Harvest', key=726f772d6331,
> columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> columnName='null')', columns=[dummy-col,])
> ------------------
> === starting
> === inserting row: row-j1, value: value-a
> === about to retrieve data
> === got (dummy-col,value-a)
> === deleting row: row-j1
> === data not found, as expected
> === re-inserting row: row-j1
> === !!!! re-inserted data not found
> === crush all boxes
> DEBUG 08:46:20,131 insert
> DEBUG 08:46:20,132 insert writing local RowMutation(keyspace='Harvest',
> key='726f772d6a31', modifications=[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='Harvest',
> key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> DEBUG 08:46:20,145 weakreadlocal reading
> SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> columnName='null')', columns=[dummy-col,])
> DEBUG 08:46:21,156 remove
> DEBUG 08:46:21,157 insert writing local RowMutation(keyspace='Harvest',
> key='726f772d6a31', modifications=[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='Harvest',
> key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> DEBUG 08:46:21,161 weakreadlocal reading
> SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> columnName='null')', columns=[dummy-col,])
> DEBUG 08:46:22,164 insert
> DEBUG 08:46:22,167 insert writing local RowMutation(keyspace='Harvest',
> key='726f772d6a31', modifications=[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='Harvest',
> key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1',
> superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
> DEBUG 08:46:22,169 weakreadlocal reading
> SliceByNamesReadCommand(table='Harvest', key=726f772d6a31,
> columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null',
> columnName='null')', columns=[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 <do...@apple.com> 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. here
> is the output
>
> of the test program
>
> === starting
>
> === inserting row: row-a, value: value-a
>
> === about to retrieve data
>
> === got (dummy-col,value-a)
>
> === deleting row: row-a
>
> === data not found, as expected
>
> === re-inserting row: row-a
>
> === !!!! re-inserted data not found
>
> === crush all boxes
>
> and subsequent inserts also fail (if you run the program again).
>
> here is the test program
>
> <CClient.java>
>
> i am just using a single node, with the following schema
>
>  create keyspace Harvest with replication_factor = 1 and placement_strategy
> = 'org.apache.cassandra.locator.SimpleStrategy';
>
>  use Harvest;
>
>  create column family Test1 with column_type = 'Standard' and comparator =
> 'UTF8Type';
>
> thanks in advance.
>
> -mike
>
>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
>

Re: can't re-insert row after deleting it?

Posted by mike dooley <do...@apple.com>.
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 line they work
as expected.  and 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'] = 'value-a';
Value inserted.
[default@Harvest] get Test1['row-c1']['dummy-col'];
=> (column=dummy-col, value=76616c75652d61, timestamp=1293727499867000)
[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'] = 'value-a';
Value inserted.
[default@Harvest] get Test1['row-c1']['dummy-col'];
=> (column=dummy-col, value=76616c75652d61, timestamp=1293727499912000)

DEBUG 08:44:59,872 insert
DEBUG 08:44:59,876 insert writing local RowMutation(keyspace='Harvest', key='726f772d6331', modifications=[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='Harvest', key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
DEBUG 08:44:59,894 weakreadlocal reading SliceByNamesReadCommand(table='Harvest', key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,])
DEBUG 08:44:59,903 remove
DEBUG 08:44:59,903 insert writing local RowMutation(keyspace='Harvest', key='726f772d6331', modifications=[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='Harvest', key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
DEBUG 08:44:59,909 weakreadlocal reading SliceByNamesReadCommand(table='Harvest', key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,])
DEBUG 08:44:59,912 insert
DEBUG 08:44:59,913 insert writing local RowMutation(keyspace='Harvest', key='726f772d6331', modifications=[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='Harvest', key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
DEBUG 08:44:59,920 weakreadlocal reading SliceByNamesReadCommand(table='Harvest', key=726f772d6331, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,])

------------------

=== starting
=== inserting row: row-j1, value: value-a
=== about to retrieve data
=== got (dummy-col,value-a)
=== deleting row: row-j1
=== data not found, as expected
=== re-inserting row: row-j1
=== !!!! re-inserted data not found
=== crush all boxes

DEBUG 08:46:20,131 insert
DEBUG 08:46:20,132 insert writing local RowMutation(keyspace='Harvest', key='726f772d6a31', modifications=[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='Harvest', key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
DEBUG 08:46:20,145 weakreadlocal reading SliceByNamesReadCommand(table='Harvest', key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,])
DEBUG 08:46:21,156 remove
DEBUG 08:46:21,157 insert writing local RowMutation(keyspace='Harvest', key='726f772d6a31', modifications=[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='Harvest', key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
DEBUG 08:46:21,161 weakreadlocal reading SliceByNamesReadCommand(table='Harvest', key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,])
DEBUG 08:46:22,164 insert
DEBUG 08:46:22,167 insert writing local RowMutation(keyspace='Harvest', key='726f772d6a31', modifications=[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='Harvest', key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[dummy-col,]) locally
DEBUG 08:46:22,169 weakreadlocal reading SliceByNamesReadCommand(table='Harvest', key=726f772d6a31, columnParent='QueryPath(columnFamilyName='Test1', superColumnName='null', columnName='null')', columns=[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 <do...@apple.com> 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. here is the output
>>> of the test program
>>> 
>>> === starting
>>> === inserting row: row-a, value: value-a
>>> === about to retrieve data
>>> === got (dummy-col,value-a)
>>> === deleting row: row-a
>>> === data not found, as expected
>>> === re-inserting row: row-a
>>> === !!!! re-inserted data not found
>>> === crush all boxes
>>> 
>>> and subsequent inserts also fail (if you run the program again).
>>> 
>>> here is the test program
>>> 
>>> <CClient.java>
>>> 
>>> i am just using a single node, with the following schema
>>> 
>>>  create keyspace Harvest with replication_factor = 1 and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>>>  use Harvest;
>>>  create column family Test1 with column_type = 'Standard' and comparator = 'UTF8Type';
>>> 
>>> thanks in advance.
>>> -mike
>> 
>> 
> 
> 
> 
> -- 
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com


Re: can't re-insert row after deleting it?

Posted by Jonathan Ellis <jb...@gmail.com>.
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 <do...@apple.com> 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. here is the output
>> of the test program
>>
>> === starting
>> === inserting row: row-a, value: value-a
>> === about to retrieve data
>> === got (dummy-col,value-a)
>> === deleting row: row-a
>> === data not found, as expected
>> === re-inserting row: row-a
>> === !!!! re-inserted data not found
>> === crush all boxes
>>
>> and subsequent inserts also fail (if you run the program again).
>>
>> here is the test program
>>
>> <CClient.java>
>>
>> i am just using a single node, with the following schema
>>
>>  create keyspace Harvest with replication_factor = 1 and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>>  use Harvest;
>>  create column family Test1 with column_type = 'Standard' and comparator = 'UTF8Type';
>>
>> thanks in advance.
>> -mike
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: can't re-insert row after deleting it?

Posted by mike dooley <do...@apple.com>.
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. here is the output
> of the test program
> 
> === starting
> === inserting row: row-a, value: value-a
> === about to retrieve data
> === got (dummy-col,value-a)
> === deleting row: row-a
> === data not found, as expected
> === re-inserting row: row-a
> === !!!! re-inserted data not found
> === crush all boxes
> 
> and subsequent inserts also fail (if you run the program again).
> 
> here is the test program
> 
> <CClient.java>
> 
> i am just using a single node, with the following schema
> 
>  create keyspace Harvest with replication_factor = 1 and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';
>  use Harvest;
>  create column family Test1 with column_type = 'Standard' and comparator = 'UTF8Type';
> 
> thanks in advance.
> -mike