mkjellman / perlcassa

a Perl client for Apache Cassandra
Apache License 2.0
20 stars 12 forks source link

exec function in perlcassa.pm fails when a node is down #44

Closed gsiglet closed 11 years ago

gsiglet commented 11 years ago

Setup: Cassandra cluster with two nodes. Trying to execute a select command to the cluster, when one node is down (keyspace made with replication factor 2), by calling $perlcassa->exec($select_query). It throws 'Cassandra::UnavailableException'

Description: It seems that the 'Cassandra::Compression::NONE' option, when calling $client->execute_prepared_cql3_query (lines 378 and 386) is not used. As a result the 'Cassandra::ConsistencyLevel::ONE' is not parsed properly. I would expect my select query to be executed when one node is down.

Solving the problem: Just commenting the lines 378 and 386 in perlcassa.pm . Btw, should 'Cassandra::ConsistencyLevel::ONE' be hard-coded in the function?

Used: Cassandra 1.2 ActivePerl 5.14.2 perlcassa 0.50

Thank you, George

mkjellman commented 11 years ago

nope, it should not be hard-coded.

i'll get that fixed right now.

mkjellman commented 11 years ago

committed in b405c120a5741baa9af0ba55b2017b575d6a222d

gsiglet commented 11 years ago

Probably there is a typo in the code. In the exec function the $opts should be %opts.