You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ying Tang <iv...@gmail.com> on 2010/09/03 05:19:35 UTC

the process of reading and writing

Recently , i read the paper about Cassandra again .
And now i have some concepts about  the reading and writing .

We all know Cassandra uses NWR ,
When read :
the request ---> a random node in Cassandra .This node acts as a proxy ,and
it routes the request.
Here ,
1. the proxy node route this request to this key's coordinator , the
coordinator then routes request to other N-1 nodes   OR   the proxy routes
the read request to N nodes ?
2. If it is the former situation , the read repair occurs on the  key's
coordinator ?
   If  it is the latter , the  read repair occurs on the proxy node ?

When write :
the request ---> a random node in Cassandra .This node acts as a proxy ,and
it routes the request.
Here ,
3. the proxy node route this request to this key's coordinator , the
coordinator then routes request to other N-1 nodes   OR   the proxy routes
the request to N nodes ?


4. The N isn't the data's copy numbers , it's just a  range . In this  N
range , there must be W copies .So W is the copy numbers.
So in this N range , R+W>N can guarantee the data's validity. Right?




-- 
Best regards,

Ivy Tang

Re: the process of reading and writing

Posted by Jonathan Ellis <jb...@gmail.com>.
To the degree that this suggests that there is a "master" node for
each range, IMO it is a "bug" in the paper.  (There are several of
these.)  Certainly there are no master nodes in Cassandra.

On Fri, Sep 3, 2010 at 12:02 AM, Ying Tang <iv...@gmail.com> wrote:
> In dynamo's paper ,it says:
> Each key, k, is assigned to a coordinator node .
> The coordinator is in charge of the replication of the data items that fall
> within its range.
> On Fri, Sep 3, 2010 at 2:56 PM, Benjamin Black <b...@b3k.us> wrote:
>>
>> On Thu, Sep 2, 2010 at 8:19 PM, Ying Tang <iv...@gmail.com> wrote:
>> > Recently , i read the paper about Cassandra again .
>> > And now i have some concepts about  the reading and writing .
>> > We all know Cassandra uses NWR ,
>> > When read :
>> > the request ---> a random node in Cassandra .This node acts as a proxy
>> > ,and
>> > it routes the request.
>> > Here ,
>> > 1. the proxy node route this request to this key's coordinator , the
>> > coordinator then routes request to other N-1 nodes   OR   the proxy
>> > routes
>> > the read request to N nodes ?
>>
>> The coordinator node is the proxy node.
>>
>> > 2. If it is the former situation , the read repair occurs on the  key's
>> > coordinator ?
>> >    If  it is the latter , the  read repair occurs on the proxy node ?
>>
>> Depends on the CL requested.  QUORUM and ALL cause the RR to be
>> performed by the coordinator.  ANY and ONE cause RR to be delegated to
>> one of the replicas for the key.
>>
>> > When write :
>> > the request ---> a random node in Cassandra .This node acts as a proxy
>> > ,and
>> > it routes the request.
>> > Here ,
>> > 3. the proxy node route this request to this key's coordinator , the
>> > coordinator then routes request to other N-1 nodes   OR   the proxy
>> > routes
>> > the request to N nodes ?
>> >
>>
>> For writes, the coordinator sends the writes directly to the replicas
>> regardless of CL (rather than delegating for weakly consistent CLs).
>>
>> > 4. The N isn't the data's copy numbers , it's just a  range . In this  N
>> > range , there must be W copies .So W is the copy numbers.
>> > So in this N range , R+W>N can guarantee the data's validity. Right?
>> >
>>
>> Sorry, I can't even parse this.
>>
>>
>> b
>
>
>
> --
> Best regards,
> Ivy Tang
>
>
>



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

Re: the process of reading and writing

Posted by Ying Tang <iv...@gmail.com>.
In dynamo's paper ,it says:

Each key, k, is assigned to a coordinator node .
The coordinator is in charge of the replication of the data items that fall
within its range.

On Fri, Sep 3, 2010 at 2:56 PM, Benjamin Black <b...@b3k.us> wrote:

> On Thu, Sep 2, 2010 at 8:19 PM, Ying Tang <iv...@gmail.com> wrote:
> > Recently , i read the paper about Cassandra again .
> > And now i have some concepts about  the reading and writing .
> > We all know Cassandra uses NWR ,
> > When read :
> > the request ---> a random node in Cassandra .This node acts as a proxy
> ,and
> > it routes the request.
> > Here ,
> > 1. the proxy node route this request to this key's coordinator , the
> > coordinator then routes request to other N-1 nodes   OR   the proxy
> routes
> > the read request to N nodes ?
>
> The coordinator node is the proxy node.
>
> > 2. If it is the former situation , the read repair occurs on the  key's
> > coordinator ?
> >    If  it is the latter , the  read repair occurs on the proxy node ?
>
> Depends on the CL requested.  QUORUM and ALL cause the RR to be
> performed by the coordinator.  ANY and ONE cause RR to be delegated to
> one of the replicas for the key.
>
> > When write :
> > the request ---> a random node in Cassandra .This node acts as a proxy
> ,and
> > it routes the request.
> > Here ,
> > 3. the proxy node route this request to this key's coordinator , the
> > coordinator then routes request to other N-1 nodes   OR   the proxy
> routes
> > the request to N nodes ?
> >
>
> For writes, the coordinator sends the writes directly to the replicas
> regardless of CL (rather than delegating for weakly consistent CLs).
>
> > 4. The N isn't the data's copy numbers , it's just a  range . In this  N
> > range , there must be W copies .So W is the copy numbers.
> > So in this N range , R+W>N can guarantee the data's validity. Right?
> >
>
> Sorry, I can't even parse this.
>
>
> b
>



-- 
Best regards,

Ivy Tang

Re: the process of reading and writing

Posted by Benjamin Black <b...@b3k.us>.
On Thu, Sep 2, 2010 at 8:19 PM, Ying Tang <iv...@gmail.com> wrote:
> Recently , i read the paper about Cassandra again .
> And now i have some concepts about  the reading and writing .
> We all know Cassandra uses NWR ,
> When read :
> the request ---> a random node in Cassandra .This node acts as a proxy ,and
> it routes the request.
> Here ,
> 1. the proxy node route this request to this key's coordinator , the
> coordinator then routes request to other N-1 nodes   OR   the proxy routes
> the read request to N nodes ?

The coordinator node is the proxy node.

> 2. If it is the former situation , the read repair occurs on the  key's
> coordinator ?
>    If  it is the latter , the  read repair occurs on the proxy node ?

Depends on the CL requested.  QUORUM and ALL cause the RR to be
performed by the coordinator.  ANY and ONE cause RR to be delegated to
one of the replicas for the key.

> When write :
> the request ---> a random node in Cassandra .This node acts as a proxy ,and
> it routes the request.
> Here ,
> 3. the proxy node route this request to this key's coordinator , the
> coordinator then routes request to other N-1 nodes   OR   the proxy routes
> the request to N nodes ?
>

For writes, the coordinator sends the writes directly to the replicas
regardless of CL (rather than delegating for weakly consistent CLs).

> 4. The N isn't the data's copy numbers , it's just a  range . In this  N
> range , there must be W copies .So W is the copy numbers.
> So in this N range , R+W>N can guarantee the data's validity. Right?
>

Sorry, I can't even parse this.


b

Re: the process of reading and writing

Posted by Ying Tang <iv...@gmail.com>.
Hi Aaron
Thanks for your reply.

In you text , does the coordinator means the random client that user send
request to ?
Do you mean no matter how many W is assigned to , the data will copy on N
node ? Just the client will think this write action is successful when W
nodes are be written ?

Ps. The key coordinator doesn't mean a single node that is responsible for
all nodes's key range . The key coordinator is the primary node that is
responsible for a key range . If a key is in its range , this node will be
this key's coordinator.


On Fri, Sep 3, 2010 at 2:36 PM, Aaron Morton <aa...@thelastpickle.com>wrote:

> AKAIK,
> For read the coordinator sends the request to the number of nodes specified
> in the RF. RR is kicked off on the coordinator node after the read has
> completed. There is no key coordinator, what would you do if it as down ?
> The first node in the list of replication nodes is considered special, but
> not that special. (In a normal read only the first node is asked for the
> data, others nodes are asked for a digest)
>
> write same as read. One hop from the coordinator node to the nodes that
> will do the write. The one hop part is discussed in the paper.
>
> N is the number of copies of the data that will be stored. W is the
> consistency level the client is happy to accept to say that the write has
> succeed, after W have ack'd to the coordinator it will ack to the client.
> But it's more complicated that that, search the archives for a big
> discussion on Handed Hint Off
>
> If you client always operates such that R+W>N you have consistency. If you
> drop the R down to 1 you may read data that is not consitent with the other
> nodes in the ring, because the coordinator returns to as soon as the first
> node does. It will then look at the result from the other nodes and kick off
> the Read Repair is needed. But this is after your read request has
> completed.
>
> Aaron
>
>
>
> On 03 Sep, 2010,at 03:19 PM, Ying Tang <iv...@gmail.com> wrote:
>
> Recently , i read the paper about Cassandra again .
> And now i have some concepts about  the reading and writing .
>
> We all know Cassandra uses NWR ,
> When read :
> the request ---> a random node in Cassandra .This node acts as a proxy ,and
> it routes the request.
> Here ,
> 1. the proxy node route this request to this key's coordinator , the
> coordinator then routes request to other N-1 nodes   OR   the proxy routes
> the read request to N nodes ?
> 2. If it is the former situation , the read repair occurs on the  key's
> coordinator ?
>    If  it is the latter , the  read repair occurs on the proxy node ?
>
> When write :
> the request ---> a random node in Cassandra .This node acts as a proxy ,and
> it routes the request.
> Here ,
> 3. the proxy node route this request to this key's coordinator , the
> coordinator then routes request to other N-1 nodes   OR   the proxy routes
> the request to N nodes ?
>
>
> 4. The N isn't the data's copy numbers , it's just a  range . In this  N
> range , there must be W copies .So W is the copy numbers.
> So in this N range , R+W>N can guarantee the data's validity. Right?
>
>
>
>
> --
> Best regards,
>
> Ivy Tang
>
>
>
>


-- 
Best regards,

Ivy Tang

Re: the process of reading and writing

Posted by Aaron Morton <aa...@thelastpickle.com>.
AKAIK, 
For read the coordinator sends the request to the number of nodes specified in the RF. RR is kicked off on the coordinator node after the read has completed. There is no key coordinator, what would you do if it as down ? The first node in the list of replication nodes is considered special, but not that special. (In a normal read only the first node is asked for the data, others nodes are asked for a digest)

write same as read. One hop from the coordinator node to the nodes that will do the write. The one hop part is discussed in the paper.

N is the number of copies of the data that will be stored. W is the consistency level the client is happy to accept to say that the write has succeed, after W have ack'd to the coordinator it will ack to the client. But it's more complicated that that, search the archives for a big discussion on Handed Hint Off. 

If you client always operates such that R+W>N you have consistency. If you drop the R down to 1 you may read data that is not consitent with the other nodes in the ring, because the coordinator returns to as soon as the first node does. It will then look at the result from the other nodes and kick off the Read Repair is needed. But this is after your read request has completed. 

Aaron

  

On 03 Sep, 2010,at 03:19 PM, Ying Tang <iv...@gmail.com> wrote:

Recently , i read the paper about Cassandra again . 
And now i have some concepts about  the reading and writing . 

We all know Cassandra uses NWR ,
When read :
the request ---> a random node in Cassandra .This node acts as a proxy ,and it routes the request.
Here , 
1. the proxy node route this request to this key's coordinator , the coordinator then routes request to other N-1 nodes   OR   the proxy routes the read request to N nodes ?
2. If it is the former situation , the read repair occurs on the  key's coordinator ? 
   If  it is the latter , the  read repair occurs on the proxy node ?

When write :
the request ---> a random node in Cassandra .This node acts as a proxy ,and it routes the request.
Here , 
3. the proxy node route this request to this key's coordinator , the coordinator then routes request to other N-1 nodes   OR   the proxy routes the request to N nodes ?


4. The N isn't the data's copy numbers , it's just a  range . In this  N range , there must be W copies .So W is the copy numbers.
So in this N range , R+W>N can guarantee the data's validity. Right?




-- 
Best regards,

Ivy Tang