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 03590926D for ; Sun, 8 Jul 2012 03:01:06 +0000 (UTC) Received: (qmail 38064 invoked by uid 500); 8 Jul 2012 03:01:03 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 37875 invoked by uid 500); 8 Jul 2012 03:01:03 -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 37850 invoked by uid 99); 8 Jul 2012 03:01:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2012 03:01:02 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tyler@datastax.com designates 209.85.217.172 as permitted sender) Received: from [209.85.217.172] (HELO mail-lb0-f172.google.com) (209.85.217.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2012 03:00:56 +0000 Received: by lbbgo11 with SMTP id go11so16049244lbb.31 for ; Sat, 07 Jul 2012 20:00:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=5t3Yv3srXn1v1V5sAp5rLXr2MlVuUcnyClqPCXbvfqI=; b=XbnuJn3RRKQbWAetMcR6qylCJqnNy0HI+dAULHzk8g03ffBpDjUQ40z4fcWmwYqHEQ Yv1wrIm6pf7MYHhP71Ragyt2lIO6Tmc0KlJZvfL3InhI+YJH65nxZk+5prqoP0xr7TzO 6x3rM7z6qMZWnANAEvx9t/qUgmYMqUR8FXdi1IXOMT9Vdo/OWcKfVgNPxo9EOTOPfAoD 5m5T8HgVeqtFGpoznfiAKrHqEI4XibbseZ8gV0kLb0STcpQPR9tjY2oj/PK8I1WvCd8A 29lkw2PDSq5wBUfXOJQu+rAtkZcCd/DfXYuVNp4fyYr2woZDihcJkx057lBoDmdyW5/p nX3Q== MIME-Version: 1.0 Received: by 10.152.111.200 with SMTP id ik8mr35322264lab.15.1341716435198; Sat, 07 Jul 2012 20:00:35 -0700 (PDT) Received: by 10.112.59.132 with HTTP; Sat, 7 Jul 2012 20:00:35 -0700 (PDT) In-Reply-To: <5EDE54A8-B082-4E31-A193-AB4AA91DB976@hexkeep.com> References: <5EDE54A8-B082-4E31-A193-AB4AA91DB976@hexkeep.com> Date: Sat, 7 Jul 2012 22:00:35 -0500 Message-ID: Subject: Re: Random errors using phpcassa From: Tyler Hobbs To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=f46d0408913182637c04c448b36f X-Gm-Message-State: ALoCoQkFw+3oXIhuaWN1VAOCnXvfLzp+RYAZS6DVJ1+w2v9Ylw6lFfNe0o7dPWR2HdIQqOpuQfJx --f46d0408913182637c04c448b36f Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable phpcassa doesn't actually support CQL at all yet, it just doesn't stop you from grabbing the connection and trying to run a cql query anyways. So, I would expect quite a few things to randomly break. Additionally, you need to set the CQL API version to 3.0.0 (I believe) using set_cql_version() on the connection in order to use cql3-specific behavior. On Fri, Jul 6, 2012 at 5:37 PM, Marco Matarazzo wrote: > Greetings. > > I am experiencing problems using a cassandra DB with phpcassa, but I am > unable to understand if the error is on phpcassa client itself or on > cassandra=85 As far as I understand, phpcassa just "pass" it to the thrif= t > layer, and errors I am seeing are coming back from cassandra itself, so I > guess it's some sort of cassandra problem (or, more easily, I am doing > something wrong but I don't know what). I hope I'm not too far from true. > > > I am using CQL3 from php pages, and I wrote a class that basically wraps > this behaviour: > > $this->pool=3Dnew > \phpcassa\Connection\ConnectionPool($keyspace,$servers); > [=85yadda yadda=85] > $client=3D$this->pool->get()->client; > > $result=3D$client->prepare_cql_query($query,\Cassandra\Compression::NONE)= ; > $itemid=3D$result->itemId; > return $client->execute_prepared_cql_query($itemid,$args)= ; > > This works ALMOST always. Sometimes, hovewere, I get "random" errors on > queries that works. When I say "Query that works" it means that on error = i > dump on screen the value of $query and $args, and this is always a valid > query that works, bot on the same page if I simply reload it, and on cqls= h > -3, with the very same parameters. > > > Sample errors, and relative queries and CF schemas are: > > =3D=3D=3D > > Executing [SELECT qt FROM cargobays USING CONSISTENCY QUORUM WHERE > corporation_id =3D ? and station_id =3D ? and item_id =3D ?] with > (edd051f0-44aa-4bc3-ad08-3174abcd1a0d,1110129,10025) > error: No indexed columns present in by-columns clause with "equals" > operator > > cqlsh:goh_release> describe columnfamily cargobays > > CREATE TABLE cargobays ( > corporation_id ascii, > station_id ascii, > item_id ascii, > qt ascii, > PRIMARY KEY (corporation_id, station_id, item_id) > ) WITH COMPACT STORAGE AND > comment=3D'' AND > caching=3D'KEYS_ONLY' AND > read_repair_chance=3D0.100000 AND > gc_grace_seconds=3D864000 AND > min_compaction_threshold=3D4 AND > max_compaction_threshold=3D32 AND > replicate_on_write=3D'true' AND > compaction_strategy_class=3D'SizeTieredCompactionStrategy' AND > compression_parameters:sstable_compression=3D'SnappyCompressor'; > > =3D=3D=3D > > Executing [UPDATE agents_skill USING CONSISTENCY QUORUM SET value =3D ? > WHERE agent_id =3D ? and skill =3D ?] with > (3,b716738b-95e6-4e22-9924-5334ee7f2f5d,pilot) > error: line 1:78 mismatched input 'and' expecting EOF > > cqlsh:goh_release> describe columnfamily agents_skill ; > > CREATE TABLE agents_skill ( > agent_id ascii, > skill ascii, > value ascii, > PRIMARY KEY (agent_id, skill) > ) WITH COMPACT STORAGE AND > comment=3D'' AND > caching=3D'KEYS_ONLY' AND > read_repair_chance=3D0.100000 AND > gc_grace_seconds=3D864000 AND > min_compaction_threshold=3D4 AND > max_compaction_threshold=3D32 AND > replicate_on_write=3D'true' AND > compaction_strategy_class=3D'SizeTieredCompactionStrategy' AND > compression_parameters:sstable_compression=3D'SnappyCompressor'; > > > We have a cluster of 3 nodes, and the keyspace is defined as follow: > > CREATE KEYSPACE v_release WITH strategy_class =3D 'SimpleStrategy' > AND strategy_options:replication_factor =3D '3'; > > > We're using (packaged) Cassandra 1.1.2 on an Ubuntu LTS 12.04. > > > I really hope it's something that can be sorted out, because we're pretty > lost here. > > Thank you. > > -- > Marco Matarazzo > > > > > --=20 Tyler Hobbs DataStax --f46d0408913182637c04c448b36f Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable phpcassa doesn't actually support CQL at all yet, it just doesn't s= top you from grabbing the connection and trying to run a cql query anyways.= =A0 So, I would expect quite a few things to randomly break.

Additio= nally, you need to set the CQL API version to 3.0.0 (I believe) using set_c= ql_version() on the connection in order to use cql3-specific behavior.

On Fri, Jul 6, 2012 at 5:37 PM, Marco Matara= zzo <marco.matarazzo@hexkeep.com> wrote:
Greetings.

I am experiencing problems using a cassandra DB with phpcassa, but I am una= ble to understand if the error is on phpcassa client itself or on cassandra= =85 As far as I understand, phpcassa just "pass" it to the thrift= layer, and errors I am seeing are coming back from cassandra itself, so I = guess it's some sort of cassandra problem (or, more easily, I am doing = something wrong but I don't know what). I hope I'm not too far from= true.


I am using CQL3 from php pages, and I wrote a class that basically wraps th= is behaviour:

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $this->pool=3Dnew \phpcassa\Connection\C= onnectionPool($keyspace,$servers);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [=85yadda yadda=85]
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $client=3D$this->pool->get()->clie= nt;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $result=3D$client->prepare_cql_query($qu= ery,\Cassandra\Compression::NONE);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $itemid=3D$result->itemId;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return $client->execute_prepared_cql_que= ry($itemid,$args);

This works ALMOST always. Sometimes, hovewere, I get "random" err= ors on queries that works. When I say "Query that works" it means= that on error i dump on screen the value of $query and $args, and this is = always a valid query that works, bot on the same page if I simply reload it= , and on cqlsh -3, with the very same parameters.


Sample errors, and relative queries and CF schemas are:

=3D=3D=3D

Executing [SELECT qt FROM cargobays USING CONSISTENCY QUORUM WHERE corporat= ion_id =3D ? and station_id =3D ? and item_id =3D ?] with (edd051f0-44aa-4b= c3-ad08-3174abcd1a0d,1110129,10025)
error: No indexed columns present in by-columns clause with "equals&qu= ot; operator

cqlsh:goh_release> describe columnfamily cargobays

CREATE TABLE cargobays (
=A0 corporation_id ascii,
=A0 station_id ascii,
=A0 item_id ascii,
=A0 qt ascii,
=A0 PRIMARY KEY (corporation_id, station_id, item_id)
) WITH COMPACT STORAGE AND
=A0 comment=3D'' AND
=A0 caching=3D'KEYS_ONLY' AND
=A0 read_repair_chance=3D0.100000 AND
=A0 gc_grace_seconds=3D864000 AND
=A0 min_compaction_threshold=3D4 AND
=A0 max_compaction_threshold=3D32 AND
=A0 replicate_on_write=3D'true' AND
=A0 compaction_strategy_class=3D'SizeTieredCompactionStrategy' AND<= br> =A0 compression_parameters:sstable_compression=3D'SnappyCompressor'= ;

=3D=3D=3D

Executing [UPDATE agents_skill USING CONSISTENCY QUORUM SET value =3D ? WHE= RE agent_id =3D ? and skill =3D ?] with (3,b716738b-95e6-4e22-9924-5334ee7f= 2f5d,pilot)
error: line 1:78 mismatched input 'and' expecting EOF

cqlsh:goh_release> describe columnfamily agents_skill ;

CREATE TABLE agents_skill (
=A0 agent_id ascii,
=A0 skill ascii,
=A0 value ascii,
=A0 PRIMARY KEY (agent_id, skill)
) WITH COMPACT STORAGE AND
=A0 comment=3D'' AND
=A0 caching=3D'KEYS_ONLY' AND
=A0 read_repair_chance=3D0.100000 AND
=A0 gc_grace_seconds=3D864000 AND
=A0 min_compaction_threshold=3D4 AND
=A0 max_compaction_threshold=3D32 AND
=A0 replicate_on_write=3D'true' AND
=A0 compaction_strategy_class=3D'SizeTieredCompactionStrategy' AND<= br> =A0 compression_parameters:sstable_compression=3D'SnappyCompressor'= ;


We have a cluster of 3 nodes, and the keyspace is defined as follow:

CREATE KEYSPACE v_release WITH strategy_class =3D 'SimpleStrategy'<= br> =A0 AND strategy_options:replication_factor =3D '3';


We're using (packaged) Cassandra 1.1.2 on an Ubuntu LTS 12.04.


I really hope it's something that can be sorted out, because we're = pretty lost here.

Thank you.

--
Marco Matarazzo







--
Tyler Hobbs
DataStax
<= br> --f46d0408913182637c04c448b36f--