incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nate McCall <n...@riptano.com>
Subject Re: can't re-insert row after deleting it?
Date Thu, 30 Dec 2010 17:12:37 GMT
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 <dooley@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 <dooley@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
>
>

Mime
View raw message