You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Ranjan Kumar <ra...@gmail.com> on 2009/09/21 16:45:16 UTC

remove column issue with cassandra-0.4.0-rc2

Hello!!
 i am using apache-cassandra-incubating-0.4.0-rc2  with java driver. The
following sequence of operations failed:

1. insert  key 'k' into a columnfamily 'cf' with column 'c' and value 'x'
for time 't'
2. remove  column 'c' from columnfamily 'cf' of key 'k'
3. insert  key 'k' into a columnfamily 'cf' with column 'c' and value 'x'
for time 't' (same time as step 1)
4. get  value of column 'c' from columnfamily 'cf' of key 'k' (this step
fails)

herewith we have attached a JUnit testcase for the above scenario.
any clues???

 --
Ranjan Kumar

Re: remove column issue with cassandra-0.4.0-rc2

Posted by Jonathan Ellis <jb...@gmail.com>.
By design, if there is a remove operation at time T and an insert at
the same time T, the remove takes precedence.  So for step 3 if you
want the new insert to "win" you need to use a time T2 such that T2 >
T.

More generally you should only use the same time T for operations that
are part of the same logical unit.  So for maximum correctness you
should use a new timestamp for each of steps 1 2 and 3.

-Jonathan

On Mon, Sep 21, 2009 at 9:45 AM, Ranjan Kumar <ra...@gmail.com> wrote:
> Hello!!
>  i am using apache-cassandra-incubating-0.4.0-rc2  with java driver. The
> following sequence of operations failed:
>
> 1. insert  key 'k' into a columnfamily 'cf' with column 'c' and value 'x'
> for time 't'
> 2. remove  column 'c' from columnfamily 'cf' of key 'k'
> 3. insert  key 'k' into a columnfamily 'cf' with column 'c' and value 'x'
> for time 't' (same time as step 1)
> 4. get  value of column 'c' from columnfamily 'cf' of key 'k' (this step
> fails)
>
> herewith we have attached a JUnit testcase for the above scenario.
> any clues???
>
>  --
> Ranjan Kumar
>