You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by ChingShen <ch...@gmail.com> on 2010/07/07 05:05:54 UTC
Some questions about the write operation and hinted handoff
Hi all,
I have A, B, C, D, E, F and G nodes(RF=3), if I run a write
operation(CL=ALL) on "A" node(coordinator), and the key range between A and
B, therefore, the data will be stored on B, C and D nodes, right? Second, if
B node is down during the write operation, does it return failure(CL=ALL) to
user? or write the data to the another node(e.g. G node) until B comes back
up and G forwards the data to him?
Thanks.
Shen
Re: Some questions about the write operation and hinted handoff
Posted by Benjamin Black <b...@b3k.us>.
Important safety tip, I did not know that.
On Thu, Jul 8, 2010 at 11:31 AM, Jonathan Ellis <jb...@gmail.com> wrote:
> On Thu, Jul 8, 2010 at 1:19 PM, Benjamin Black <b...@b3k.us> wrote:
>> On Thu, Jul 8, 2010 at 9:02 AM, ChingShen <ch...@gmail.com> wrote:
>>> Hmm.. as you mentioned that it will write a hint and report success at
>>> CL.ANY, does the hinted handoff only work at CL.ANY?
>>>
>>
>> Still no. Hints are written when nodes are down, regardless of CL,
>> unless HH is disabled. CL does not influence whether hints are
>> written, it influences whether success is reported to the client. For
>> CL.ANY a hint is a success, for CL.ONE it is a failure.
>
> If the coordinator knows it can't achieve the requested CL it won't do
> any writes, hinted or otherwise, and will immediately report
> UnavailableException to the client.
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Jul 8, 2010 at 10:45 PM, ChingShen <ch...@gmail.com> wrote:
> Ok, If so, I suppose that A sends requests to B, C and D nodes(RF=3) at
> CL.QUORUM, but D is down, then return success message to the client, and A
> write a hint to E node? until D comes back up then E forwards the data to D?
If it knows that D is down before it starts, then it will tag the
write to B or C with a "replay this row to D" hint. Otherwise, it
will attempt to write to D, which will fail. Either way a QUORUM
write would succeed.
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by ChingShen <ch...@gmail.com>.
On Fri, Jul 9, 2010 at 4:32 AM, Jonathan Ellis <jb...@gmail.com> wrote:
> If the coordinator knows it can't achieve the requested CL it won't do
> any writes, hinted or otherwise, and will immediately report
> UnavailableException to the client.
> To summarize: hinted writes are only generated when Cassandra (a)
> knows a target is down ahead of time and (b) still has enough UP
> targets to satisfy the requested CL.
Ok, If so, I suppose that A sends requests to B, C and D nodes(RF=3) at *
CL.QUORUM*, but D is down, then return success message to the client, and* A
write a hint to E node*? until D comes back up then E forwards the data to
D?
Thanks.
Shen
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
Right, if the nodes are marked up but do not confirm the writes, it
will result in a TimedOutException. (It still won't generate hinted
writes).
To summarize: hinted writes are only generated when Cassandra (a)
knows a target is down ahead of time and (b) still has enough UP
targets to satisfy the requested CL.
On Thu, Jul 8, 2010 at 1:48 PM, Benjamin Black <b...@b3k.us> wrote:
> To clarify, this requires the coordinator know nodes are down. If the
> nodes are marked UP, but do not confirm the writes, this behavior does
> not seem possible.
>
> On Thu, Jul 8, 2010 at 11:31 AM, Jonathan Ellis <jb...@gmail.com> wrote:
>> On Thu, Jul 8, 2010 at 1:19 PM, Benjamin Black <b...@b3k.us> wrote:
>>> On Thu, Jul 8, 2010 at 9:02 AM, ChingShen <ch...@gmail.com> wrote:
>>>> Hmm.. as you mentioned that it will write a hint and report success at
>>>> CL.ANY, does the hinted handoff only work at CL.ANY?
>>>>
>>>
>>> Still no. Hints are written when nodes are down, regardless of CL,
>>> unless HH is disabled. CL does not influence whether hints are
>>> written, it influences whether success is reported to the client. For
>>> CL.ANY a hint is a success, for CL.ONE it is a failure.
>>
>> If the coordinator knows it can't achieve the requested CL it won't do
>> any writes, hinted or otherwise, and will immediately report
>> UnavailableException to the client.
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of Riptano, the source for professional Cassandra support
>> http://riptano.com
>>
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by Benjamin Black <b...@b3k.us>.
To clarify, this requires the coordinator know nodes are down. If the
nodes are marked UP, but do not confirm the writes, this behavior does
not seem possible.
On Thu, Jul 8, 2010 at 11:31 AM, Jonathan Ellis <jb...@gmail.com> wrote:
> On Thu, Jul 8, 2010 at 1:19 PM, Benjamin Black <b...@b3k.us> wrote:
>> On Thu, Jul 8, 2010 at 9:02 AM, ChingShen <ch...@gmail.com> wrote:
>>> Hmm.. as you mentioned that it will write a hint and report success at
>>> CL.ANY, does the hinted handoff only work at CL.ANY?
>>>
>>
>> Still no. Hints are written when nodes are down, regardless of CL,
>> unless HH is disabled. CL does not influence whether hints are
>> written, it influences whether success is reported to the client. For
>> CL.ANY a hint is a success, for CL.ONE it is a failure.
>
> If the coordinator knows it can't achieve the requested CL it won't do
> any writes, hinted or otherwise, and will immediately report
> UnavailableException to the client.
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Jul 8, 2010 at 1:19 PM, Benjamin Black <b...@b3k.us> wrote:
> On Thu, Jul 8, 2010 at 9:02 AM, ChingShen <ch...@gmail.com> wrote:
>> Hmm.. as you mentioned that it will write a hint and report success at
>> CL.ANY, does the hinted handoff only work at CL.ANY?
>>
>
> Still no. Hints are written when nodes are down, regardless of CL,
> unless HH is disabled. CL does not influence whether hints are
> written, it influences whether success is reported to the client. For
> CL.ANY a hint is a success, for CL.ONE it is a failure.
If the coordinator knows it can't achieve the requested CL it won't do
any writes, hinted or otherwise, and will immediately report
UnavailableException to the client.
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by Benjamin Black <b...@b3k.us>.
On Thu, Jul 8, 2010 at 9:02 AM, ChingShen <ch...@gmail.com> wrote:
> Hmm.. as you mentioned that it will write a hint and report success at
> CL.ANY, does the hinted handoff only work at CL.ANY?
>
Still no. Hints are written when nodes are down, regardless of CL,
unless HH is disabled. CL does not influence whether hints are
written, it influences whether success is reported to the client. For
CL.ANY a hint is a success, for CL.ONE it is a failure.
b
Re: Some questions about the write operation and hinted handoff
Posted by ChingShen <ch...@gmail.com>.
Hmm.. as you mentioned that it will *write a hint *and report success at
CL.ANY, does the hinted handoff only work at CL.ANY?
Thanks.
On Thu, Jul 8, 2010 at 11:29 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> On Thu, Jul 8, 2010 at 10:23 AM, ChingShen <ch...@gmail.com>
> wrote:
> > Thanks Jonathan Ellis,
> >
> > I want to make sure that after A return failure message to client at
> > CL.ONE, does A write a hint to C?
>
> No.
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Jul 8, 2010 at 10:23 AM, ChingShen <ch...@gmail.com> wrote:
> Thanks Jonathan Ellis,
>
> I want to make sure that after A return failure message to client at
> CL.ONE, does A write a hint to C?
No.
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by ChingShen <ch...@gmail.com>.
Thanks Jonathan Ellis,
I want to make sure that after A return failure message to client at
CL.ONE, *does A write a hint to C?* If so, although the write operation is
failed, but the data is still stored in C? if B comes back up, then C
forwards to B?
Shen
On Thu, Jul 8, 2010 at 10:08 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> On Thu, Jul 8, 2010 at 12:45 AM, ChingShen <ch...@gmail.com>
> wrote:
> > hmm... I'm really confused.
> > The http://wiki.apache.org/cassandra/API document mentioned that if
> write
> > ConsistencyLevel=ANY that "Ensure the write has been written to at least
> 1
> > node, including hinted recipients.", I couldn't imagine this case. :(
> >
> > If I have A,B,C and D nodes(RF=1), and write ConsistencyLevel=ANY, so A
> > coordinator node sends a write request to another node(e.g. B node), but
> B
> > node is down during write operation, what happend? return failure message
> to
> > client immediately? or write a hint to another node(e.g. C node)
>
> It will write a hint and report success.
>
> But if you were writing at CL.ONE it would fail the write because a
> hinted write isn't readable until it can be forwarded to the "right"
> node (here, B).
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Jul 8, 2010 at 12:45 AM, ChingShen <ch...@gmail.com> wrote:
> hmm... I'm really confused.
> The http://wiki.apache.org/cassandra/API document mentioned that if write
> ConsistencyLevel=ANY that "Ensure the write has been written to at least 1
> node, including hinted recipients.", I couldn't imagine this case. :(
>
> If I have A,B,C and D nodes(RF=1), and write ConsistencyLevel=ANY, so A
> coordinator node sends a write request to another node(e.g. B node), but B
> node is down during write operation, what happend? return failure message to
> client immediately? or write a hint to another node(e.g. C node)
It will write a hint and report success.
But if you were writing at CL.ONE it would fail the write because a
hinted write isn't readable until it can be forwarded to the "right"
node (here, B).
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by ChingShen <ch...@gmail.com>.
hmm... I'm really confused.
The http://wiki.apache.org/cassandra/API document mentioned that if write
ConsistencyLevel=ANY that "Ensure the write has been written to at least 1
node, including hinted recipients.", I couldn't imagine this case. :(
If I have A,B,C and D nodes(RF=1), and write ConsistencyLevel=ANY, so A
coordinator node sends a write request to another node(e.g. B node), but B
node is down during write operation, what happend? return failure message to
client immediately? or write a hint to another node(e.g. C node) and return
success message to client? or could anyone can give me a real case?
Thanks.
Shen
On Thu, Jul 8, 2010 at 12:48 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> No, it means that HH writes don't count towards meeting the requested
> ConsistencyLevel.
>
> On Wed, Jul 7, 2010 at 9:36 PM, ChingShen <ch...@gmail.com> wrote:
> > So, does it mean that only the CL=ZERO and CL=ANY support hinted handoff,
> > right?
> >
> > Thanks.
> >
> > Shen
> >
> > On Wed, Jul 7, 2010 at 11:28 PM, Jonathan Ellis <jb...@gmail.com>
> wrote:
> >>
> >> does http://wiki.apache.org/cassandra/HintedHandoff help?
> >>
> >> On Wed, Jul 7, 2010 at 10:16 AM, ChingShen <ch...@gmail.com>
> >> wrote:
> >> > Thanks Jonathan Ellis,
> >> >
> >> > If so, how does the hinted handoff work? I thought the coordinator
> >> > node
> >> > will write the data to another node(e.g. G node), I'm confused.
> >> >
> >> > Shen
> >> >
> >> >>
> >> >> > Second, if
> >> >> > B node is down during the write operation, does it return
> >> >> > failure(CL=ALL) to
> >> >> > user?
> >> >>
> >> >> yes
> >> >>
> >> >> --
> >> >> Jonathan Ellis
> >> >> Project Chair, Apache Cassandra
> >> >> co-founder of Riptano, the source for professional Cassandra support
> >> >> http://riptano.com
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Jonathan Ellis
> >> Project Chair, Apache Cassandra
> >> co-founder of Riptano, the source for professional Cassandra support
> >> http://riptano.com
> >
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
No, it means that HH writes don't count towards meeting the requested
ConsistencyLevel.
On Wed, Jul 7, 2010 at 9:36 PM, ChingShen <ch...@gmail.com> wrote:
> So, does it mean that only the CL=ZERO and CL=ANY support hinted handoff,
> right?
>
> Thanks.
>
> Shen
>
> On Wed, Jul 7, 2010 at 11:28 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>>
>> does http://wiki.apache.org/cassandra/HintedHandoff help?
>>
>> On Wed, Jul 7, 2010 at 10:16 AM, ChingShen <ch...@gmail.com>
>> wrote:
>> > Thanks Jonathan Ellis,
>> >
>> > If so, how does the hinted handoff work? I thought the coordinator
>> > node
>> > will write the data to another node(e.g. G node), I'm confused.
>> >
>> > Shen
>> >
>> >>
>> >> > Second, if
>> >> > B node is down during the write operation, does it return
>> >> > failure(CL=ALL) to
>> >> > user?
>> >>
>> >> yes
>> >>
>> >> --
>> >> Jonathan Ellis
>> >> Project Chair, Apache Cassandra
>> >> co-founder of Riptano, the source for professional Cassandra support
>> >> http://riptano.com
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of Riptano, the source for professional Cassandra support
>> http://riptano.com
>
>
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by ChingShen <ch...@gmail.com>.
So, does it mean that only the CL=ZERO and CL=ANY support hinted handoff,
right?
Thanks.
Shen
On Wed, Jul 7, 2010 at 11:28 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> does http://wiki.apache.org/cassandra/HintedHandoff help?
>
> On Wed, Jul 7, 2010 at 10:16 AM, ChingShen <ch...@gmail.com>
> wrote:
> > Thanks Jonathan Ellis,
> >
> > If so, how does the hinted handoff work? I thought the coordinator node
> > will write the data to another node(e.g. G node), I'm confused.
> >
> > Shen
> >
> >>
> >> > Second, if
> >> > B node is down during the write operation, does it return
> >> > failure(CL=ALL) to
> >> > user?
> >>
> >> yes
> >>
> >> --
> >> Jonathan Ellis
> >> Project Chair, Apache Cassandra
> >> co-founder of Riptano, the source for professional Cassandra support
> >> http://riptano.com
> >
> >
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
does http://wiki.apache.org/cassandra/HintedHandoff help?
On Wed, Jul 7, 2010 at 10:16 AM, ChingShen <ch...@gmail.com> wrote:
> Thanks Jonathan Ellis,
>
> If so, how does the hinted handoff work? I thought the coordinator node
> will write the data to another node(e.g. G node), I'm confused.
>
> Shen
>
>>
>> > Second, if
>> > B node is down during the write operation, does it return
>> > failure(CL=ALL) to
>> > user?
>>
>> yes
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of Riptano, the source for professional Cassandra support
>> http://riptano.com
>
>
>
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
Re: Some questions about the write operation and hinted handoff
Posted by ChingShen <ch...@gmail.com>.
Thanks Jonathan Ellis,
If so, how does the hinted handoff work? I thought the coordinator node
will write the data to another node(e.g. G node), I'm confused.
Shen
> > Second, if
> > B node is down during the write operation, does it return failure(CL=ALL)
> to
> > user?
>
> yes
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>
Re: Some questions about the write operation and hinted handoff
Posted by Jonathan Ellis <jb...@gmail.com>.
On Tue, Jul 6, 2010 at 10:05 PM, ChingShen <ch...@gmail.com> wrote:
> Hi all,
>
> I have A, B, C, D, E, F and G nodes(RF=3), if I run a write
> operation(CL=ALL) on "A" node(coordinator), and the key range between A and
> B, therefore, the data will be stored on B, C and D nodes, right?
depends on replication strategy. with rackunawarestrategy it will be b/c/d.
> Second, if
> B node is down during the write operation, does it return failure(CL=ALL) to
> user?
yes
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com