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: batch mutate with only deletions on 0.7beta2
Date Thu, 16 Dec 2010 15:56:33 GMT
There are a couple of .NET clients listed on the wiki. Aquiles
particularly seems to be getting a lot of attention recently:
http://aquiles.codeplex.com/

Unless you have a specific use case (or are just experimenting) it's
best to avoid raw Thrift and make use of an existing library so you do
not have to roll your own pooling, configuration, etc.

On Wed, Dec 15, 2010 at 9:04 PM, Nick Santini <nick.santini@kaseya.com> wrote:
> found the issue, was on the logic of the test
> sorry about crying wolf :-p
> thanks for reading and all your help guys
>
> Nicolas Santini
> On Thu, Dec 16, 2010 at 3:55 PM, Nick Santini <nick.santini@kaseya.com>
> wrote:
>>
>> btw, inside the test the data row gets deleted, but not the secondary
>> index row/columns
>>
>> Nicolas Santini
>>
>>
>> On Thu, Dec 16, 2010 at 3:53 PM, Nick Santini <nick.santini@kaseya.com>
>> wrote:
>>>
>>> ok, after a few tests and debugs ive found that is actually deleting
>>> those columns, so great
>>> but the problem is different than what I thought it was. Im running the
>>> test which does:
>>> - create and save a row (here I save the secondary indexes)
>>> - find the row by a secondary index
>>> - delete the row (here I update the secondary indexes deleting the
>>> corresponding columns)
>>> - find the row by the same index -> this shouldnt return my row
>>> but it does!
>>> so apparently the deletion is not getting there when I read again, even
>>> if I put the thread to sleep 10 seconds
>>> funny is that, after the test finished, I try to get that row manually
>>> but all the deletes have gone through, even the secondary index ones
>>>
>>>
>>> Nicolas Santini
>>>
>>> On Thu, Dec 16, 2010 at 3:11 PM, Aaron Morton <aaron@thelastpickle.com>
>>> wrote:
>>>>
>>>> Nick,
>>>> The docs for the DateTime in .net say it's resolution is only 10ms. You
>>>> should try to find a higher resolution time source to
>>>> avoid accidentally sending multiple mutations (including deletions) with
the
>>>> same time stamp. I'm not sure it's the cause of this problem, but it can
>>>> result in cases where a delete is not applied because there is an insert
>>>> with the same timestamp.
>>>> In python I use the seconds since epoch with 6 decimal places shifted
>>>> left.
>>>> Also, turn up the cassanfra logging level to DEBUG and make sure you are
>>>> sending what you think you are. Chances are you are sending the wrong data
>>>> in the request.
>>>>
>>>> Let me know how you get on.
>>>> Aaron
>>>> On 16 Dec, 2010,at 02:11 PM, Nick Santini <nick.santini@kaseya.com>
>>>> wrote:
>>>>
>>>> Im using thrift directly on C#
>>>> the code that is trying to delete all the columns referencing the row im
>>>> deleting on the secondary index rows looks like this
>>>> Mutation mutation = new Mutation();
>>>> mutation.Deletion = new Deletion();
>>>> mutation.Deletion.Timestamp = DateTime.Now.ToBinary();
>>>> List<byte[]> predicate = new List<byte[]>();
>>>> predicate.Add(utf8.GetBytes(columnName));
>>>> mutation.Deletion.Predicate = new SlicePredicate()
>>>> {
>>>>    Column_names = predicate
>>>> };
>>>> mutations.Add(mutation);
>>>> entry = new Dictionary<string, List<Mutation>>();
>>>> entry.Add(cfName, mutations);
>>>> mutation_map.Add(utf8EncodingInstance.GetBytes(secIndexKey), entry);
>>>> CassandraClient.batch_mutate(mutation_map, ConsistencyLevel.ONE);
>>>>
>>>> now, the code where I inserted the references is exactly the same, but
>>>> without the deletion part in the mutations
>>>>
>>>>
>>>> Nicolas Santini
>>>>
>>>> On Thu, Dec 16, 2010 at 12:55 PM, Tyler Hobbs <tyler@riptano.com> wrote:
>>>>>
>>>>> What client are you using? If you're not using a client, what does your
>>>>> deletion code look like?
>>>>>
>>>>> - Tyler
>>>>>
>>>>>
>>>>> On Wed, Dec 15, 2010 at 4:58 PM, Nick Santini <nick.santini@kaseya.com>
>>>>> wrote:
>>>>>>
>>>>>> thats not exactly what im seeing, is not a row, but columns on a
row
>>>>>> that i was deleting
>>>>>> ie:
>>>>>> suppose i have a row where the key is sec_index_1 where i have two
>>>>>> columns with information about other row keys
>>>>>> sec_index_1 { key1:key1, key2:key2 }
>>>>>> then i add a deletion for the column named key2, run it through batch
>>>>>> mutate for the key sec_index_1
>>>>>> then i load the row again to see all my "references" stored in
>>>>>> columns, and im still getting
>>>>>> key1, key2
>>>>>>
>>>>>> Nicolas Santini
>>>>>>
>>>>>>
>>>>>> On Thu, Dec 16, 2010 at 11:52 AM, Tyler Hobbs <tyler@riptano.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> There's no problem doing deletions with batch_mutate, but you
are
>>>>>>> probably seeing this:
>>>>>>>
>>>>>>> http://wiki.apache.org/cassandra/FAQ#range_ghosts
>>>>>>>
>>>>>>> - Tyler
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Dec 15, 2010 at 4:26 PM, Nick Santini
>>>>>>> <nick.santini@kaseya.com> wrote:
>>>>>>>>
>>>>>>>> since the 0.7beta2 version doesnt support indexes for Super
CF or
>>>>>>>> for columns that you might not now the name yet, im supporting
them manually
>>>>>>>> by adding a row on the same CF where the key is the name
of the column plus
>>>>>>>> the value, and in the columns hold the key to the referenced
rows
>>>>>>>> this works as in i can actually find my rows using the secondary
>>>>>>>> index rows
>>>>>>>> but when i try to delete the original row i want to update
my
>>>>>>>> secondary indexs, so i create a mutation map in the same
way i did it when i
>>>>>>>> saved my information, but this time it only contains deletions
for those
>>>>>>>> secondary indexs rows and only for the column referencing
to the row being
>>>>>>>> deleted.
>>>>>>>> but this doesnt seem to work, it comes back successfully
(no erros),
>>>>>>>> but im still able to find the references to the deleted row
in those
>>>>>>>> secondary indexes
>>>>>>>> is there any issue trying to run a batch_mutate with only
deletions?
>>>>>>>> thanks
>>>>>>>> Nicolas Santini
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>

Mime
View raw message