Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAA457346 for ; Mon, 5 Dec 2011 09:48:11 +0000 (UTC) Received: (qmail 61173 invoked by uid 500); 5 Dec 2011 09:48:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 60391 invoked by uid 500); 5 Dec 2011 09:48:04 -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 60364 invoked by uid 99); 5 Dec 2011 09:48:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 09:48:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yulinyen@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-ee0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 09:47:54 +0000 Received: by eekd4 with SMTP id d4so175705eek.31 for ; Mon, 05 Dec 2011 01:47:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SLFhoQSRgyla4riodFE9llnq7bf/OrsnDa746Xn5AlA=; b=ruMa5sWCnGn5NtN2eA5peNCo1Fjc4fNsMVnUcX4IJBpjV4vl7n4ufJzQGYZ5dn0x0t PkFK5nPJlbJfZmemX3S6yGfYkWBxzBigWFVTv3QebUmOwVsfx/HgXNQMjPChgkdEA2ra x5V2qqO7cs6E+kjyW1pejMh+qlI2fkeCnNvjI= MIME-Version: 1.0 Received: by 10.213.105.193 with SMTP id u1mr487877ebo.11.1323078454479; Mon, 05 Dec 2011 01:47:34 -0800 (PST) Received: by 10.14.19.195 with HTTP; Mon, 5 Dec 2011 01:47:34 -0800 (PST) In-Reply-To: References: Date: Mon, 5 Dec 2011 17:47:34 +0800 Message-ID: Subject: Re: DyanmicCompositeType bug? From: Boris Yen To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0015174c18384a0dc004b35535a3 X-Virus-Checked: Checked by ClamAV on apache.org --0015174c18384a0dc004b35535a3 Content-Type: text/plain; charset=ISO-8859-1 It looks like using the dynamicComposite is a dangerous action. However, one mistaken insertion causes the database to corrupt seems a little bit too much. Is there anyway to just skip the wrong column. On Mon, Dec 5, 2011 at 5:31 PM, Sylvain Lebresne wrote: > On Mon, Dec 5, 2011 at 8:19 AM, Boris Yen wrote: > > Hi, > > > > I am using 0.8.7. > > > > I was trying to use DynamicComposite column. After I intentional added a > > column (string:string:uuid) into a record which has previous columns > > inserted with comparator (string:uuid:uuid). I got an exception on the > > cassandra side and an timeout exception on the client (I was actually > > expecting an validation exception on the client). > > By design, the DynamicComposite comparator cannot return a validation > exception in that case. Or rather, since there is nothing specifying how > a column should look like, the only way we could ever hope to return a > validation exception would be to scan the entire row on insertion (which > is out of question). > > > After that when I re-started cassandra, cassandra kept saying that > > "comparator mismatch while comparing two dynamicCompositeType column..." > and > > cassandra never really got started. > > > > Is this a bug? > > No. As said above, this is something we cannot do anything about. > The DynamicCompositeType comparator is by nature a very dangerous > one. One column inserted in the wrong row can corrupt that row (with > recovery involving losing data). > In other words, don't use DynamicCompositeType. Don't use it unless > you are absolutely sure you won't ever insert the wrong column in the > wrong row *and* you absolutely need the DynamicCompositeType (by > opposition to the faster, cheaper and safe CompositeType). And if you > do, you have to assume the consequence if you do mess up. > > -- > Sylvain > > -- > Sylvain > --0015174c18384a0dc004b35535a3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It looks like using the dynamicComposite is a dangerous action. However, on= e mistaken insertion causes the database to corrupt seems a little bit too = much. Is there anyway to just skip the wrong column.

On Mon, Dec 5, 2011 at 5:31 PM, Sylvain Lebresne <sylvain@datastax.com> wro= te:
On Mon, Dec 5, 2011 at 8:19 AM, Boris Yen <yulinyen@gmail.com> wrote:
> Hi,
>
> I am using 0.8.7.
>
> I was trying to use DynamicComposite column. After I intentional added= a
> column (string:string:uuid) into a record which has previous columns > inserted with comparator (string:uuid:uuid). I got an exception on the=
> cassandra side and an timeout exception on the client (I was actually<= br> > expecting an validation exception on the client).

By design, the DynamicComposite comparator cannot return a validation=
exception in that case. Or rather, since there is nothing specifying how a column should look like, the only way we could ever hope to return a
validation exception would be to scan the entire row on insertion (which is out of question).

> After that when I re-started cassandra, cassandra kept=A0saying that > "comparator mismatch while comparing two dynamicCompositeType col= umn..." and
> cassandra never really got started.
>
> Is this a bug?

No. As said above, this is something we cannot do anything about.
The DynamicCompositeType comparator is by nature a very dangerous
one. One column inserted in the wrong row can corrupt that row (with
recovery involving losing data).
In other words, don't use DynamicCompositeType. Don't use it unless=
you are absolutely sure you won't ever insert the wrong column in the wrong row *and* you absolutely need the DynamicCompositeType (by
opposition to the faster, cheaper and safe CompositeType). And if you
do, you have to assume the consequence if you do mess up.

--
Sylvain

--
Sylvain

--0015174c18384a0dc004b35535a3--