Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 91915 invoked from network); 26 May 2010 18:35:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 May 2010 18:35:02 -0000 Received: (qmail 2765 invoked by uid 500); 26 May 2010 18:35:02 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 2747 invoked by uid 500); 26 May 2010 18:35:02 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 2739 invoked by uid 99); 26 May 2010 18:35:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 18:35:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 18:35:00 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4QIYchQ013729 for ; Wed, 26 May 2010 18:34:38 GMT Message-ID: <4130880.5241274898878185.JavaMail.jira@thor> Date: Wed, 26 May 2010 14:34:38 -0400 (EDT) From: "Gary Dusbabek (JIRA)" To: commits@cassandra.apache.org Subject: [jira] Updated: (CASSANDRA-1122) Lack of subcomparator_type will corrupt the keyspace in Thrift system_add_keyspace() In-Reply-To: <25384164.19771274736505163.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CASSANDRA-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Dusbabek updated CASSANDRA-1122: ------------------------------------- Attachment: 0001-CFMeta.subcolumncomparator-should-default-to-BytesTy.patch > Lack of subcomparator_type will corrupt the keyspace in Thrift system_add_keyspace() > ------------------------------------------------------------------------------------ > > Key: CASSANDRA-1122 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1122 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.7 > Environment: CentOS 5.2 - Linux 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:30:06 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux > apache-cassandra-2010-05-21_13-27-42 > Thrift 2.0 with patch https://issues.apache.org/jira/browse/THRIFT-780 > PHP 5.2 > Reporter: Arya Goudarzi > Assignee: Gary Dusbabek > Fix For: 0.7 > > Attachments: 0001-CFMeta.subcolumncomparator-should-default-to-BytesTy.patch, test_cass.php > > > I had a problem earlier where I create a Keyspace by reading the default yaml config shipped with the above cassandra package and after parsing and creating the keyspace with PHP Thrift system_add_keysapce command, I would get 'TException: Error: Internal error processing describe_keyspace ' when trying to get describe_keyspace. In cassandra-cli I get the same error. > The cassandra log shows a null pointed exception: > ERROR [pool-1-thread-39] 2010-05-24 14:17:35,204 Cassandra.java (line 1943) Internal error processing describe_keyspace > java.lang.NullPointerException > at org.apache.cassandra.thrift.CassandraServer.describe_keyspace(CassandraServer.java:476) > at org.apache.cassandra.thrift.Cassandra$Processor$describe_keyspace.process(Cassandra.java:1939) > at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:1276) > at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:253) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:636) > I traced down the problem to where I define cassandra_CfDef. When the type is Super and subcomparator_type is not set, Thrift code does not set it to any default value but blank "". The command system_add_keyspace() runs with no problem. Whatever happens in Cassandra afterwards, will create a useless keyspace. > Here is my code snippet to generate the exception: > $GLOBALS['THRIFT_ROOT'] = '/usr/share/php/Thrift'; > require_once $GLOBALS['THRIFT_ROOT'].'/packages/cassandra/Cassandra.php'; > require_once $GLOBALS['THRIFT_ROOT'].'/packages/cassandra/cassandra_types.php'; > require_once $GLOBALS['THRIFT_ROOT'].'/transport/TSocket.php'; > require_once $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php'; > require_once $GLOBALS['THRIFT_ROOT'].'/transport/TFramedTransport.php'; > require_once $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php'; > try { > // Make a connection to the Thrift interface to Cassandra > $socket = new TSocket('127.0.0.1', 9160); > $transport = new TBufferedTransport($socket, 1024, 1024); > $protocol = new TBinaryProtocolAccelerated($transport); > $client = new CassandraClient($protocol); > $transport->open(); > //Try creating some keyspace/column family defs > $ks = new cassandra_KsDef(); > $ks->name = 'agoudarzi_Keyspace1'; > $ks->strategy_class = 'org.apache.cassandra.locator.RackUnawareStrategy'; > $ks->replication_factor = '1'; > > //Now add a column family to it > $cf = new cassandra_CfDef(); > $cf->name = 'Super3'; > $cf->table = 'agoudarzi_Keyspace1'; > $cf->column_type = 'Super'; > $cf->comparator_type = 'LongType'; > $cf->row_cache_size = '0'; > $cf->key_cache_size = '50'; > $cf->comment = 'A column family with supercolumns, whose column names are Longs (8 bytes)'; > $ks->cf_defs[] = $cf; > $client->system_add_keyspace($ks); > > sleep(2); > > //Try to check if keyspace description is good > $client->set_keyspace('agoudarzi_Keyspace1'); > $rs = $client->describe_keyspace('agoudarzi_Keyspace1'); > $transport->close(); > } catch (TException $tx) { > print 'TException: '.$tx->why. ' Error: '.$tx->getMessage() . "\n"; > } > ?> > I think a default subcomparator should be set by thrift or other defensive method be used to prevent this problem. > Please investigate. > Thanks. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.