I came across aforementioned line in blog http://docs.datastax.com/en/archived/cassandra/2.0/cassandra/dml/dml_about_hh_c.html

Its quite confusing. So let's say I have 5 node cluster, with RF of 3 and Write Consistency as Quorum i.e. 2 nodes

Now, if I try to write something and out of three replica nodes for given particular data, two were down. So, does this mean that cassandra won't store hint (as it knows it won't be able meet given consistency of quorum in first place)? and reject that write right away OR it will store hint for them and give success in response?

Can someone please elaborate on this?

2

There are 2 answers

2
JayK On BEST ANSWER

There are two different mechanics at hand here. Let me give you an example to clarify.

Assume I have a cluster of 3 nodes with 3 replication and consistency Quorum(2). This means that when I write to the database I will have to get two responses to satisfy my query.

After I satisfy my query, the node will have to send this write to the 3rd node. The node which has handled the query tries to send the write to the 3rd node. That node is currently unavailable, which causes the node to write a hinted handoff instead. Then it returns success to the client.

Note that hinted handoff happens after the consistency has been met. The hinted handoff makes sure that the write gets to all nodes which hold a replica.

Now there is one exception to this which is mentioned in the article you posted. Consistency level ANY is a consistency level that will be satisfied by writing a hinted handoff as long as there is a node which can serve the request.

5
bechbd On

If you have a RF=3 and 2 nodes are down or unable to service the request in a timely manner then the write request will fail and the hinted handoff will not be stored. Hinted handoffs will only be stored if the Consistency Level (CL) for the request can be met and you are within the hinted handoff window. The only exception to this would be a request written with a CL=ANY.