Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 12849 invoked from network); 16 Dec 2010 02:56:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Dec 2010 02:56:23 -0000 Received: (qmail 65734 invoked by uid 500); 16 Dec 2010 02:56:21 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 65587 invoked by uid 500); 16 Dec 2010 02:56:21 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 65579 invoked by uid 99); 16 Dec 2010 02:56:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 02:56:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nick.santini@kaseya.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-iw0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 02:56:14 +0000 Received: by iwn40 with SMTP id 40so3100045iwn.31 for ; Wed, 15 Dec 2010 18:55:53 -0800 (PST) Received: by 10.42.220.73 with SMTP id hx9mr6695154icb.521.1292468153026; Wed, 15 Dec 2010 18:55:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.8.133 with HTTP; Wed, 15 Dec 2010 18:55:32 -0800 (PST) In-Reply-To: References: From: Nick Santini Date: Thu, 16 Dec 2010 15:55:32 +1300 Message-ID: Subject: Re: batch mutate with only deletions on 0.7beta2 To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf3054a0bd25073c04977e31eb X-Virus-Checked: Checked by ClamAV on apache.org --20cf3054a0bd25073c04977e31eb Content-Type: text/plain; charset=ISO-8859-1 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 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 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 >> 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 predicate = new List(); >> predicate.Add(utf8.GetBytes(columnName)); >> >> mutation.Deletion.Predicate = new SlicePredicate() >> { >> Column_names = predicate >> }; >> >> mutations.Add(mutation); >> >> entry = new Dictionary>(); >> 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 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 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 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 >>>> > 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 >>>>>> >>>>>> >>>>> >>>> >>> >> > --20cf3054a0bd25073c04977e31eb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
btw, inside the test the data row gets deleted, but not the secondary = index row/columns


Nicolas Santin= i



On Thu, Dec 16, 2010 at 3:53 PM, Nick Sa= ntini <nick= .santini@kaseya.com> wrote:
Nicolas Santini
<= div>


On Thu, Dec 16, 2010 at 3:11 PM, Aaron M= orton <aaron@thelastpickle.com> wrote:
Nick,=A0
The docs for the DateTime in .net say it's= resolution is only 10ms. You should try to find a higher resolution time s= ource to avoid=A0accidentally=A0sending multiple mutations (including delet= ions) 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.=A0

In python I use the seconds since epoch with 6 decimal = places shifted left.

Also, turn up the cassanfra l= ogging 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.=A0

Let me know how you get on.=A0
Aaron

On 16 Dec, 2010,at 02:11 PM, Nick Santini <nick.santini@kaseya.c= om> wrote:

Im using thrift directly= on C#
the code that is trying to delete all the columns referenc= ing the row im deleting on the secondary index rows looks like this

Mutation mutation =3D new Mutation();
mutation.Deletion =3D new Deletion();
mutation.Deletion= .Timestamp =3D DateTime.Now.ToBinary();

List<by= te[]> predicate =3D new List<byte[]>();
predi= cate.Add(utf8.GetBytes(columnName));

mutation.Deletion.Predicate =3D new SlicePredicate()
{
=A0=A0 Column_names =3D predicate
};

mutations.Add(mutation);

entry =3D new Dictionary<string, List<Mutation>>();
entry.Add(cfName, mutations);

mutation_= map.Add(utf8EncodingInstance.GetBytes(secIndexKey), entry);

<= /div>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, 201= 0 at 4:58 PM, Nick Santini <nick.santini@kaseya.com> w= rote:
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=A0sec_in= dex_1 where i have two columns with information about other row keys
sec_index_1 { key1:key1, key2:key2 }

then i a= dd a deletion for the column named key2, run it through batch mutate for th= e 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 proba= bly seeing this:

http://wiki.apache.org/cassandra/FAQ#range_gho= sts

- Tyler



On Wed, Dec 15, 2010 at 4:26 PM, Nick Santin= i <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 t= he 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 m= ap in the same way i did it when i saved my information, but this time it o= nly contains deletions for those secondary indexs rows and only for the col= umn referencing to the row being deleted.
but this doesnt seem to work, it comes back=A0successfully (no erros),= but im still able to find the references to the deleted row in those secon= dary indexes

is there any issue trying to run a ba= tch_mutate with only deletions?

thanks=A0

Nicolas Santini






--20cf3054a0bd25073c04977e31eb--