You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Shammi Jayasinghe <sh...@wso2.com> on 2012/01/20 12:42:38 UTC

delay in data deleting in cassadra

Hi,
  I am experiencing a delay in delete operations in cassandra. Its as
follows. I am running a thread which contains following three steps.

Step 01: Read data from column family "foo"    [1]
Step 02: Process received data eg: bar1,bar2,bar3,bar4,bar5
Step 03: Remove those processed data from "foo".[2]

 The problem occurs when this thread is invoked for the second time.
In that step , it returns some of data that i already deleted in the third
step of the previous cycle.

Eg: it returns bar2,bar3,bar4,bar5

It seems though i called the remove operation as follows [2], it takes time
to replicate it to
the file system. If i make a thread sleep of 5 secs between the thread
cycles, it does not
give me any data that i deleted in the third step.

 [1] . SliceQuery<String, String, byte[]> sliceQuery =
                    HFactory.createSliceQuery(keyspace, stringSerializer,
stringSerializer, bs);
            sliceQuery.setKey(queueName);
            sliceQuery.setRange("", "", false, messageCount);
            sliceQuery.setColumnFamily(USER_QUEUES_COLUMN_FAMILY);

 [2].  Mutator<String> mutator = HFactory.createMutator(keyspace,
stringSerializer);
        mutator.addDeletion(queueName, USER_QUEUES_COLUMN_FAMILY,
messageId, stringSerializer);
        mutator.execute();



Is there a solution for this.

Cassadra version : 0.8.0
Libthrift version : 0.6.1


Thanks
Shammi
-- 
Best Regards,*

Shammi Jayasinghe*
Senior Software Engineer; WSO2, Inc.; http://wso2.com,
mobile: +94 71 4493085

Re: delay in data deleting in cassadra

Posted by Shammi Jayasinghe <sh...@wso2.com>.
On Mon, Jan 23, 2012 at 2:10 PM, Shammi Jayasinghe <sh...@wso2.com> wrote:

>
>
> On Fri, Jan 20, 2012 at 11:02 PM, Peter Schuller <
> peter.schuller@infidyne.com> wrote:
>
>> >  The problem occurs when this thread is invoked for the second time.
>> > In that step , it returns some of data that i already deleted in the
>> third
>> > step of the previous cycle.
>>
>> In order to get a guarantee about a subsequent read seeing a write,
>> you must read and write at QUORUM (or LOCAL_QUORUM if it's only within
>> a DC).
>>
>> Hi ,
>  I tried with changing the consistency level to QUORUM. But unfortunately
> it behaves same as previous.
>

Hi,

 I am sorry, it worked fine when the Consistency Level Set to QUORUM. Thank
you very very much for help.

Thanks
Shammi

>
> Thanks
> Shammi
>
>> --
>> / Peter Schuller (@scode, http://worldmodscode.wordpress.com)
>>
>
>
>
> --
> Best Regards,*
>
> Shammi Jayasinghe*
> Senior Software Engineer; WSO2, Inc.; http://wso2.com,
> mobile: +94 71 4493085
>
>
>


-- 
Best Regards,*

Shammi Jayasinghe*
Senior Software Engineer; WSO2, Inc.; http://wso2.com,
mobile: +94 71 4493085

Re: delay in data deleting in cassadra

Posted by Shammi Jayasinghe <sh...@wso2.com>.
On Fri, Jan 20, 2012 at 11:02 PM, Peter Schuller <
peter.schuller@infidyne.com> wrote:

> >  The problem occurs when this thread is invoked for the second time.
> > In that step , it returns some of data that i already deleted in the
> third
> > step of the previous cycle.
>
> In order to get a guarantee about a subsequent read seeing a write,
> you must read and write at QUORUM (or LOCAL_QUORUM if it's only within
> a DC).
>
> Hi ,
 I tried with changing the consistency level to QUORUM. But unfortunately
it behaves same as previous.

Thanks
Shammi

> --
> / Peter Schuller (@scode, http://worldmodscode.wordpress.com)
>



-- 
Best Regards,*

Shammi Jayasinghe*
Senior Software Engineer; WSO2, Inc.; http://wso2.com,
mobile: +94 71 4493085

Re: delay in data deleting in cassadra

Posted by Peter Schuller <pe...@infidyne.com>.
>  The problem occurs when this thread is invoked for the second time.
> In that step , it returns some of data that i already deleted in the third
> step of the previous cycle.

In order to get a guarantee about a subsequent read seeing a write,
you must read and write at QUORUM (or LOCAL_QUORUM if it's only within
a DC).

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)

Re: delay in data deleting in cassadra

Posted by aaron morton <aa...@thelastpickle.com>.
also, *please* upgrade to the latest 0.8 release. 

Cheers 
-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 21/01/2012, at 4:31 PM, Maxim Potekhin wrote:

> Did you run repairs withing GC_GRACE all the time?
> 
> 
> 
> On 1/20/2012 3:42 AM, Shammi Jayasinghe wrote:
>> 
>> Hi,
>>   I am experiencing a delay in delete operations in cassandra. Its as follows. I am running a thread which contains following three steps.
>> 
>> Step 01: Read data from column family "foo"    [1]
>> Step 02: Process received data eg: bar1,bar2,bar3,bar4,bar5 
>> Step 03: Remove those processed data from "foo".[2]
>> 
>>  The problem occurs when this thread is invoked for the second time.
>> In that step , it returns some of data that i already deleted in the third step of the previous cycle.
>> 
>> Eg: it returns bar2,bar3,bar4,bar5
>> 
>> It seems though i called the remove operation as follows [2], it takes time to replicate it to 
>> the file system. If i make a thread sleep of 5 secs between the thread cycles, it does not 
>> give me any data that i deleted in the third step.
>> 
>>  [1] . SliceQuery<String, String, byte[]> sliceQuery =
>>                     HFactory.createSliceQuery(keyspace, stringSerializer, stringSerializer, bs);
>>             sliceQuery.setKey(queueName);
>>             sliceQuery.setRange("", "", false, messageCount);
>>             sliceQuery.setColumnFamily(USER_QUEUES_COLUMN_FAMILY);
>> 
>>  [2].  Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
>>         mutator.addDeletion(queueName, USER_QUEUES_COLUMN_FAMILY, messageId, stringSerializer);
>>         mutator.execute();
>> 
>>  
>> 
>> Is there a solution for this.
>> 
>> Cassadra version : 0.8.0
>> Libthrift version : 0.6.1
>> 
>> 
>> Thanks
>> Shammi 
>> -- 
>> Best Regards, 
>>  
>> Shammi Jayasinghe
>> Senior Software Engineer; WSO2, Inc.; http://wso2.com,
>> mobile: +94 71 4493085 
>> 
>> 
> 


Re: delay in data deleting in cassadra

Posted by Maxim Potekhin <po...@bnl.gov>.
Did you run repairs withing GC_GRACE all the time?



On 1/20/2012 3:42 AM, Shammi Jayasinghe wrote:
> Hi,
>   I am experiencing a delay in delete operations in cassandra. Its as 
> follows. I am running a thread which contains following three steps.
>
> Step 01: Read data from column family "foo"    [1]
> Step 02: Process received data eg: bar1,bar2,bar3,bar4,bar5
> Step 03: Remove those processed data from "foo".[2]
>
>  The problem occurs when this thread is invoked for the second time.
> In that step , it returns some of data that i already deleted in the 
> third step of the previous cycle.
>
> Eg: it returns bar2,bar3,bar4,bar5
>
> It seems though i called the remove operation as follows [2], it takes 
> time to replicate it to
> the file system. If i make a thread sleep of 5 secs between the thread 
> cycles, it does not
> give me any data that i deleted in the third step.
>
>  [1] . SliceQuery<String, String, byte[]> sliceQuery =
>                     HFactory.createSliceQuery(keyspace, 
> stringSerializer, stringSerializer, bs);
>             sliceQuery.setKey(queueName);
>             sliceQuery.setRange("", "", false, messageCount);
>             sliceQuery.setColumnFamily(USER_QUEUES_COLUMN_FAMILY);
>
>  [2].  Mutator<String> mutator = HFactory.createMutator(keyspace, 
> stringSerializer);
>         mutator.addDeletion(queueName, USER_QUEUES_COLUMN_FAMILY, 
> messageId, stringSerializer);
>         mutator.execute();
>
>
> Is there a solution for this.
>
> Cassadra version : 0.8.0
> Libthrift version : 0.6.1
>
>
> Thanks
> Shammi
> -- 
> Best Regards,*
>
> Shammi Jayasinghe*
> Senior Software Engineer; WSO2, Inc.; http://wso2.com <http://wso2.com/>,
> mobile: +94 71 4493085
>
>