cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric tamme <>
Subject Re: Docs: Token Selection
Date Fri, 17 Jun 2011 16:27:30 GMT
On Fri, Jun 17, 2011 at 12:07 PM, AJ <> wrote:
> Thanks Jonathan.  I assumed since each data center owned the full key space
> that the first replica would be stored in the dc of the coordinating node,
> the 2nd in another dc, and the 3rd+ back in the 1st dc.  But, are you saying
> that the first endpoint is selected regardless of the location of the
> coordinating node?  Are you saying that the starting endpoint is the one
> closest to the row token regardless of the dc?

Cassandra will write to the node whose Initial Token is closest
without being larger then the data's token.  It doesn't take into
consideration what node was the recipient of the request (which i
guess is what you are calling the coordinating node).  The proximity
of a node is determined by your endpoint snitch - so it is a
determining factor in figuring out who gets a write in the condition
of overlapping token ranges.

> So, it is possible that a
> replica might not even get stored in the dc of the coordinator at all
> depending on how many dc's there are, rf, starting token assignments, etc.?

Cassandra determines replica writes the same way it would do for
primary insertion, but it is subject to the constraints of your
replica placement strategy, and how it determines locality based on
your endpoint snitch. So yes, It is entirely possible that the DC that
the "coordinator" is in will not get any replica, its really dependent
on your initial tokens, endpoint snitch, and placement strategy.


View raw message