You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Narendra Sharma <na...@gmail.com> on 2011/01/05 10:37:53 UTC

Cassandra 0.7 - Query on network topology

Hi,

We are working on defining the ring topology for our cluster. One of the
plans under discussion is to have a RF=2 and perform read/write operations
with CL=ONE. I know this could be an issue since it doesn't satisfy R+W >
RF. This will work if we can always force the clients to go to the first
node responsible for the data and go to its replica only if the first node
is not available.

For eg assume the ring is following with token space from 0 to 100. Assume
random parititioner is used.
A[0] -> B[25] -> C[50] -> D[75]

so going by SimpleStrategy, the replica for A will be B, for B it will be C
and so on.

What I am looking for is:
1. Some way to send requests for keys whose token fall between 0-25 to B and
never to C even though C will have the data due to it being replica of B.
2. Only when B is down or not reachable, the request should go to C.
3. Once the requests start going to C, they should continue unless C is down
and in which case the requests should then go to B.

My understanding is that SimpleSnitch should fit here except for the
enforcing #3 above. I should be able to extend the SimpleSnitch to add the
behavior described in #3 above. Question is will SimpleSnitch come into
picture if the request from client reaches node C directly? If yes, will it
proxy request to B? I don't want C to serve request for keys in range 0-25
unless B is down.


One way this can be feasible is if I do key -> token -> node mapping in my
client. But this might get messy as I will have to keep track of nodes in
the ring etc.

Comments/suggestions are welcome.

Thanks,
Naren

Re: Cassandra 0.7 - Query on network topology

Posted by Jonathan Ellis <jb...@gmail.com>.
On Wed, Jan 5, 2011 at 3:37 AM, Narendra Sharma
<na...@gmail.com> wrote:
> What I am looking for is:
> 1. Some way to send requests for keys whose token fall between 0-25 to B and
> never to C even though C will have the data due to it being replica of B.
> 2. Only when B is down or not reachable, the request should go to C.
> 3. Once the requests start going to C, they should continue unless C is down
> and in which case the requests should then go to B.
>
> My understanding is that SimpleSnitch should fit here except for the
> enforcing #3 above.

Right, with the caveat that you'll probably want to set the dynamic
snitch badness threshold to allow switching to B even if C merely gets
overloaded rather than completely down.  The alternative is disabling
the dynamic snitch entirely.

> will SimpleSnitch come into
> picture if the request from client reaches node C directly?

Yes.

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

Re: Cassandra 0.7 - Query on network topology

Posted by Peter Schuller <pe...@infidyne.com>.
> 1. Some way to send requests for keys whose token fall between 0-25 to B and
> never to C even though C will have the data due to it being replica of B.

If your data set is large, be mindful of the fact that this will cause
C to be completely cold in terms of caches. I.e., when B does go down,
C will take lots of iops.

-- 
/ Peter Schuller