cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Sample <mike.sam...@gmail.com>
Subject Node selection when both partition key and secondary index field constrained?
Date Mon, 28 Jan 2013 03:24:13 GMT
Does the following FAQ entry hold even when the partion key is also
constrained in the query (by token())?

http://wiki.apache.org/cassandra/SecondaryIndexes:
==
   Q: How does choice of Consistency Level affect cluster availability when
using secondary indexes?

   A: Because secondary indexes are distributed, you must have CL nodes
available for all token ranges in the cluster in order to complete a query.
For example, with RF = 3, when two out of three consecutive nodes in the
ring are unavailable, all secondary index queries at CL = QUORUM will fail,
however secondary index queries at CL = ONE will succeed. This is true
regardless of cluster size."
==

For example:

CREATE TABLE foo (
    id uuid,
    seq_num bigint,
    flag boolean,
    some_other_data blob,
    PRIMARY KEY (id,seq_num)
);

CREATE INDEX flag_index ON foo (flag);

SELECT id, flag from foo WHERE TOKEN(id) > '-9939393' AND TOKEN(id) <= '0'
AND flag=true;

Would the above query with LOCAL_QUORUM succeed given the following? IE is
the token range used first trim node selection?

* the cluster has 18 nodes
* foo is in a keyspace with a replication factor of 3 for that data center
* 2 nodes in one of the replication groups are down
* the token range in the query is not in the range of the down nodes


Thanks in advance!

Mime
View raw message