Return-Path: Delivered-To: apmail-incubator-cassandra-dev-archive@minotaur.apache.org Received: (qmail 5314 invoked from network); 8 Feb 2010 23:31:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2010 23:31:14 -0000 Received: (qmail 93939 invoked by uid 500); 8 Feb 2010 23:31:14 -0000 Delivered-To: apmail-incubator-cassandra-dev-archive@incubator.apache.org Received: (qmail 93909 invoked by uid 500); 8 Feb 2010 23:31:14 -0000 Mailing-List: contact cassandra-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-dev@incubator.apache.org Received: (qmail 93897 invoked by uid 99); 8 Feb 2010 23:31:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 23:31:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jackculpepper@gmail.com designates 209.85.221.204 as permitted sender) Received: from [209.85.221.204] (HELO mail-qy0-f204.google.com) (209.85.221.204) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 23:31:08 +0000 Received: by qyk42 with SMTP id 42so1724585qyk.11 for ; Mon, 08 Feb 2010 15:30:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=UIl53M1y8jWx/qoi4a0xVffYhB9yJLhW9eHdcf5FhHs=; b=C2wiyGjVtaBjzCTYBpfR4sJQyhlGsg9hi/ZQJTUsmlVLkpUKzdsrwwB/AGrZE7oy6D WvnOEpe/tdsTQCHTsTw23pfmnkKvNrvnn5sSYT+kc1bPF0kLoeuB+YWGu9F049FaVned r7m8XA/qUwoI2IpRBOFW/RwHwaRHQi2wlLgr8= 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 :content-type:content-transfer-encoding; b=ZNbO3yakER1PcQCqA3DAKtv9TUni+CNBadUOWBEm9EoBFogYm2Cx/KvWzYbSzX/JHA 9JXckwHlh2pbxNaKGtidHNyH+a+AhjlmRCIDuoU4tS41aulyqU/z/bZpXm4Dr2bFwAp/ QJIW2U453QbLaV1RLiW2I/F1vYV8lSKHrnZbQ= MIME-Version: 1.0 Received: by 10.229.26.135 with SMTP id e7mr871773qcc.58.1265671847238; Mon, 08 Feb 2010 15:30:47 -0800 (PST) In-Reply-To: References: <261c158e1002081401h33d708dfif07d1931817de363@mail.gmail.com> <261c158e1002081442o4b668e0end88d82eb19572523@mail.gmail.com> From: Jack Culpepper Date: Mon, 8 Feb 2010 15:30:27 -0800 Message-ID: <261c158e1002081530r1debe4f2ndb8df90c02533c8f@mail.gmail.com> Subject: Re: get_range_slice() tester To: cassandra-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable No, dang. Obviously, get_key_range() is gone, but I get an exception for get_range_slice(): ERROR 23:25:04,497 Internal error processing get_range_slice java.lang.AssertionError at org.apache.cassandra.dht.Bounds.(Bounds.java:16) at org.apache.cassandra.dht.Bounds.restrictTo(Bounds.java:34) at org.apache.cassandra.service.StorageProxy.getRangeSlice(StorageP= roxy.java:559) at org.apache.cassandra.thrift.CassandraServer.get_range_slice(Cass= andraServer.java:560) at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slice.= process(Cassandra.java:1189) at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandr= a.java:984) at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TTh= readPoolServer.java:253) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoo= lExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExe= cutor.java:908) at java.lang.Thread.run(Thread.java:619) To get trunk running I modified storage-conf.xml as follows: Changed to reflect my two nodes. Deleted "localhost" from and . Also, I deleted everything from my data and commitlog dirs on both machines. That's it. Jack On Mon, Feb 8, 2010 at 2:58 PM, Jonathan Ellis wrote: > I'm seeing failures on 0.5 but success against trunk, is that also what y= ou see? > > -Jonathan > > On Mon, Feb 8, 2010 at 4:42 PM, Jack Culpepper = wrote: >> On Mon, Feb 8, 2010 at 2:34 PM, Jonathan Ellis wrote= : >>> This is supposed to pass on a single node but fail on two, correct? >> >> Yep! At least, it does for me. >> >>> What are the tokens on your two nodes, in case that is relevant? >>> (nodeprobe ring will tell you.) >> >> Heh, unfortunately this also shows the fact that I accidentally >> blasted one of my data dirs. ;) >> >> $ sudo bin/nodeprobe -host localhost ring >> [sudo] password for jack: >> Address =A0 =A0 =A0 Status =A0 =A0 Load =A0 =A0 =A0 =A0 =A0Range >> =A0 =A0 =A0 =A0 =A0 Ring >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 YQVhw0uDS4RMOASI >> 10.212.87.165 Up =A0 =A0 =A0 =A0 8.18 KB =A0 =A0 =A0 13DyIzn2EhRAHOq9 >> =A0 =A0 =A0 =A0 =A0 |<--| >> 10.212.230.176Up =A0 =A0 =A0 =A0 11.71 GB =A0 =A0 =A0YQVhw0uDS4RMOASI >> =A0 =A0 =A0 =A0 =A0 |-->| >> >> J >> >>> -Jonathan >>> >>> On Mon, Feb 8, 2010 at 4:01 PM, Jack Culpepper wrote: >>>> Here's a tester program, for contrib. It generates 10 keys using uuid, >>>> inserts them both into the cassandra column family Keyspace1/Super1 >>>> and a python dictionary. Then, it does a range scan using both methods >>>> and marks the keys that are returned. Finally, it goes through the >>>> python dictionary, makes sure a cassandra get() on each key works >>>> (should through an exception on failure), and complains about keys >>>> that were not found in the range scan. >>>> >>>> To run, put the contents in test_bug.py then run like this: >>>> >>>> python test_bug.py get_key_range >>>> >>>> (Nothing printed means it worked.) >>>> >>>> python test_bug.py get_range_slice >>>> >>>> (Keys that should have been found in a range scan, but were not, are p= rinted.) >>>> >>>> Best, >>>> >>>> Jack >>>> >>>> >>>> >>>> import sys >>>> import time >>>> import uuid >>>> >>>> from thrift import Thrift >>>> from thrift.transport import TTransport >>>> from thrift.transport import TSocket >>>> from thrift.protocol.TBinaryProtocol import TBinaryProtocolAccelerated >>>> from cassandra import Cassandra >>>> from cassandra.ttypes import * >>>> >>>> num_keys =3D 10 >>>> >>>> socket =3D TSocket.TSocket("10.212.87.165", 9160) >>>> transport =3D TTransport.TBufferedTransport(socket) >>>> protocol =3D TBinaryProtocol.TBinaryProtocolAccelerated(transport) >>>> client =3D Cassandra.Client(protocol) >>>> >>>> ks =3D "Keyspace1" >>>> cf =3D "Super1" >>>> cl =3D ConsistencyLevel.ONE >>>> >>>> d =3D {} >>>> >>>> transport.open() >>>> >>>> if 1: >>>> =A0 =A0## insert keys using the raw thrift interface >>>> =A0 =A0cpath =3D ColumnPath(cf, "foo", "is") >>>> =A0 =A0value =3D "cool" >>>> >>>> =A0 =A0for i in xrange(num_keys): >>>> =A0 =A0 =A0 =A0ts =3D time.time() >>>> =A0 =A0 =A0 =A0key =3D uuid.uuid4().hex >>>> =A0 =A0 =A0 =A0client.insert(ks, key, cpath, value, ts, cl) >>>> =A0 =A0 =A0 =A0d[key] =3D 1 >>>> >>>> else: >>>> =A0 =A0## insert keys using pycassa! >>>> =A0 =A0import pycassa >>>> >>>> =A0 =A0client =3D pycassa.connect(["10.212.87.165:9160"]) >>>> =A0 =A0cf_test =3D pycassa.ColumnFamily(client, ks, cf, super=3DTrue) >>>> >>>> =A0 =A0for i in xrange(num_keys): >>>> =A0 =A0 =A0 =A0key =3D uuid.uuid4().hex >>>> =A0 =A0 =A0 =A0cf_test.insert(key, { 'params' : { 'is' : 'cool' }}) >>>> =A0 =A0 =A0 =A0d[key] =3D 1 >>>> >>>> >>>> cparent =3D ColumnParent(column_family=3Dcf) >>>> slice_range =3D SliceRange(start=3D"key", finish=3D"key") >>>> p =3D SlicePredicate(slice_range=3Dslice_range) >>>> >>>> done =3D False >>>> seg =3D 1000 >>>> start =3D "" >>>> >>>> ## do a scan using either get_key_range() (deprecated) or get_range_sl= ice() >>>> ## for every key returned that is in the dictionary, mark it as found >>>> while not done: >>>> =A0 =A0if sys.argv[1] =3D=3D "get_key_range": >>>> =A0 =A0 =A0 =A0result =3D client.get_key_range(ks, cf, start, "", seg,= cl) >>>> >>>> =A0 =A0 =A0 =A0if len(result) < seg: done =3D True >>>> =A0 =A0 =A0 =A0else: start =3D result[seg-1] >>>> >>>> =A0 =A0 =A0 =A0for r in result: >>>> =A0 =A0 =A0 =A0 =A0 =A0if d.has_key(r): >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0d[r] =3D 0 >>>> >>>> =A0 =A0if sys.argv[1] =3D=3D "get_range_slice": >>>> =A0 =A0 =A0 =A0result =3D client.get_range_slice(ks, cparent, p, start= , "", seg, cl) >>>> >>>> =A0 =A0 =A0 =A0if len(result) < seg: done =3D True >>>> =A0 =A0 =A0 =A0else: start =3D result[seg-1].key >>>> >>>> =A0 =A0 =A0 =A0for r in result: >>>> =A0 =A0 =A0 =A0 =A0 =A0if d.has_key(r.key): >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0d[r.key] =3D 0 >>>> >>>> cpath =3D ColumnPath(column_family=3Dcf, super_column=3D'foo') >>>> >>>> ## get, remove all the keys >>>> ## print all the keys that were not marked 0 >>>> for k in d: >>>> =A0 =A0result =3D client.get(ks, k, cpath, cl) >>>> =A0 =A0#print result >>>> >>>> =A0 =A0if d[k] =3D=3D 1: >>>> =A0 =A0 =A0 =A0print k, "not marked 0" >>>> =A0 =A0#else: >>>> =A0 =A0# =A0 =A0print k, "was marked 0!" >>>> >>>> =A0 =A0ts =3D time.time() >>>> =A0 =A0client.remove(ks, k, cpath, ts, cl) >>>> >>> >> >