Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 86596 invoked from network); 8 Apr 2011 01:57:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2011 01:57:40 -0000 Received: (qmail 54628 invoked by uid 500); 8 Apr 2011 01:57:38 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 54602 invoked by uid 500); 8 Apr 2011 01:57:38 -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 54593 invoked by uid 99); 8 Apr 2011 01:57:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 01:57:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jbellis@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 01:57:32 +0000 Received: by vws12 with SMTP id 12so2917512vws.31 for ; Thu, 07 Apr 2011 18:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=dtLdHY+0dKyaN1EvJIzCju5mB5y15s+yU6z8aAHXZCo=; b=Ljg7lSBnV98aoZ/wcwdEUgJkPVs9nXPv40WJetyHernim/HAW0x9cK/UtQ2uEEIPq3 pKvobYhi6Si4FUFP6Rj1+uIBSJ+RMA8pKGA5zW73LAufMs2smq6p05y5AqncZ8fi/7TT Iq8xRSrJxDIM3DRzeshGzB9kAhLsSOQM2wzJU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=gi83kpU8+9Y+JNYixdCXW3xRNXoyNeir+c9YYBvBLKtEgo6uxiulG18bCoPVSFcqp0 x9Ywu8KBwsqYuv5Ri/rtLJG3hB6oLRh1V526ahjXoNEeLWyM4tmb7ZY3RA3cG/SvJI3F dkqxVv1iQY6peiUrMpaYWq/Pic3iiGayQa9FQ= Received: by 10.52.65.225 with SMTP id a1mr2281367vdt.183.1302227831096; Thu, 07 Apr 2011 18:57:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.163.33 with HTTP; Thu, 7 Apr 2011 18:56:51 -0700 (PDT) In-Reply-To: <2E615361C20CC44E99D51DA8E981F77472085A9BFA@GVW1362EXC.americas.hpqcorp.net> References: <2E615361C20CC44E99D51DA8E981F77472085A9B48@GVW1362EXC.americas.hpqcorp.net> <2E615361C20CC44E99D51DA8E981F77472085A9BFA@GVW1362EXC.americas.hpqcorp.net> From: Jonathan Ellis Date: Thu, 7 Apr 2011 20:56:51 -0500 Message-ID: Subject: Re: Secondary Index Updates Break CLI and Client Code Reading :: DebugLog Attached To: user@cassandra.apache.org Cc: "Fryar, Dexter" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Addressed on the issue you created, https://issues.apache.org/jira/browse/CASSANDRA-2436. On Thu, Apr 7, 2011 at 12:19 PM, Fryar, Dexter wrote: > I have also attached the debug log with each step attached. I've even tri= ed going back and updating the CF with the old index to no avail. You can i= nsert/write all you want, but reads will fail if you come across a row that= included one of these cases. > > log4j-server.properties > =A0 =A0 =A0 =A0log4j.rootLogger=3DDEBUG,stdout,R > > > > -----Original Message----- > From: Fryar, Dexter > Sent: Thursday, April 07, 2011 11:19 AM > To: user@cassandra.apache.org > Subject: Secondary Index Updates Break CLI and Client Code Reading > > Creating an index, validator, and default validator then renaming/droppin= g the index later results in read errors. > > > Is there an easy way around this problem without having to keep an invali= d definition for a column that will get deleted or expired? > > > 1) create a secondary index on a column with a validator and a default va= lidator > 2) insert a row > 3) read and verify the row > 4) update the CF/index/name/validator > 5) read the CF and get an error (CLI or Pycassa) > > > CLI Commands to create the row and CF/Index > > create column family cf_testing with comparator=3DUTF8Type and default_va= lidation_class=3DUTF8Type and column_metadata=3D[{column_name: colour, vali= dation_class: LongType, index_type: KEYS}]; > > set cf_testing['key']['colour']=3D'1234'; > list cf_testing; > > update column family cf_testing with comparator=3DUTF8Type and default_va= lidation_class=3DUTF8Type and column_metadata=3D[{column_name: color, valid= ation_class: LongType, index_type: KEYS}]; > > > ERROR from the CLI: > > list cf_testing; > Using default limit of 100 > ------------------- > RowKey: key > invalid UTF8 bytes 00000000000004d2 > > > > Here is the Pycassa client code that shows this error too. > > > badindex.py > > #!/usr/local/bin/python2.7 > > import pycassa > import uuid > import sys > > def main(): > =A0try: > =A0 =A0keyspace=3D"badindex" > =A0 =A0serverPoolList =3D ['localhost:9160'] > =A0 =A0pool =3D pycassa.connect(keyspace, serverPoolList) > =A0except: > =A0 =A0print "couldn't get a connection" > =A0 =A0sys.exit() > > =A0cfname=3D"cf_testing" > =A0cf =3D pycassa.ColumnFamily(pool, cfname) > =A0results =3D cf.get_range(start=3D'key', finish=3D'key', row_count=3D1) > =A0for key, columns in results: > =A0 =A0print key, '=3D>', columns > > if __name__ =3D=3D "__main__": > =A0main() > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com