You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by AJ <aj...@dude.podzone.net> on 2011/06/10 20:09:03 UTC

Consistency Levels and Replication with Down Nodes

The O'Reilly book on Cass says this about READ consistency level ALL:

"Query all nodes. Wait for all nodes to respond, and return to the 
client the record with the most recent timestamp. Then, if necessary, 
perfrom a read repair in the background.  If any nodes fail or respond, 
fail the read operation."

It says "all nodes".  Shouldn't it say "replication_factor nodes"?  The 
above is implying that if a node, that doesn't even have a copy of the 
row, is down, then the read will fail.  Is that true?



Here is a related question regarding the WRITE consistency level ALL.  
The book says:

"Ensure that the number of nodes specified by replication_factor 
received the write before returning to the client.  If even one replica 
is unresponsive to the write operation, fail the operation."

I can understand this if the given row already exists from a previous 
write and one of the nodes that contains a replica is down.  But, what 
if this is the FIRST time creating this row and one of the nodes that it 
determines should store one of the replicas is down?  Will it choose 
another node to store the replica, or will it use hints to update the 
chosen down node when it comes back up?


Generally speaking for any RF value and for the FIRST write of a 
particular row, does Cass select specific nodes to contain the replicas 
regardless of their availability, and use hints if some of them are 
unavailable?  Or, will it select another available node?

Thanks

Re: Consistency Levels and Replication with Down Nodes

Posted by Jonathan Ellis <jb...@gmail.com>.
On Fri, Jun 10, 2011 at 1:09 PM, AJ <aj...@dude.podzone.net> wrote:
> It says "all nodes".  Shouldn't it say "replication_factor nodes"?

My preferred phrasing would be "all replicas."

> I can understand this if the given row already exists from a previous write
> and one of the nodes that contains a replica is down.  But, what if this is
> the FIRST time creating this row and one of the nodes that it determines
> should store one of the replicas is down?  Will it choose another node to
> store the replica, or will it use hints to update the chosen down node when
> it comes back up?

ALL means ALL.

There is no such thing as "choosing another node to store a replica;"
replicas are determined by the partitioner and replication strategy
and cannot be changed at whim.  (How would you know where to find your
data, if replicas were not deterministic?)

> Generally speaking for any RF value and for the FIRST write of a particular
> row, does Cass select specific nodes to contain the replicas regardless of
> their availability, and use hints if some of them are unavailable?  Or, will
> it select another available node?

You should read http://wiki.apache.org/cassandra/Operations.

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com