You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Prabhjot Bharaj <pr...@gmail.com> on 2015/08/30 17:47:36 UTC

Doubt in Atomic Broadcast

Hello Folks,

I am going through zookeeper internals described here:
http://zookeeper.apache.org/doc/r3.4.6/zookeeperInternals.html

I have some very basic doubts in understanding the Gurantees - *Reliable
delivery, **Total order *and *Causal order*

1. I do not understand the term - 'delivery' and 'order' in these sections.
   a) Delivery - Does 'delivery' refer to delivery of messages from server
to server or server to client ?
   b) Order - As per this link:
https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos, state
updates must be ordered - What kind of state updates are these ? Does the
term - 'order' in this link and the one shared in the top of this email
have the same meaning ?

2. *'**If a message, m, is delivered by one server, it will be eventually
delivered by all servers.'* - delivered <from what> <to what> ?

3. If a and b are delivered messages, either a will be delivered before b
or b will be delivered before a -- dont really understand what this means !

4. the terms sender - Does sender classify as one of the zookeeper servers
in the cluster or the client ?


Request you to share your knowledge on my doubts so I can learn more on the
internals and be able to use zookeeper effectively

Thanks,
Prabhjot

RE: Doubt in Atomic Broadcast

Posted by "Ibrahim El-sanosi (PGR)" <i....@newcastle.ac.uk>.
I have found that Paxos, Zab and Raft have relatively  similar structure and purpose. For example, all are centralization approach and providing total order for state machine update. The only different is that the number and the name of round-trips for write operation which are only  different.  It is true that the leader election (looking phase) may be different but I am here comparing the protocols in failure-free period.  

Regards,

Ibrahim

-----Original Message-----
From: Flavio Junqueira [mailto:fpjunqueira@yahoo.com.INVALID] 
Sent: Sunday, August 30, 2015 07:47 م
To: user@zookeeper.apache.org
Subject: Re: Doubt in Atomic Broadcast

Thanks for the insight, Martin.

On 30 Aug 2015, at 18:20, Martin Kersten <ma...@gmail.com> wrote:
> 
> Hi,
> 
>   Zookeeper is all about a shared state called a consensus.

Consensus in the context of zookeeper is about agreeing on state. 

> So everything
> that it is at its core is providing any means of joining a group of 
> servers and elect a leader and share information that result in a 
> predictable shared state that all servers agree on.
> 

There is a distinction between clients and servers. Client connect to an ensemble and submit requests. The requests that update the state are replicated to make sure that the replicas remain consistent.

As for predictability, I think you're referring to consistency. There are too many possible issues in a distributed system that make predictability really hard if not impossible.

> The most popular consensus algorithm is the Raft algorithm:
> https://ramcloud.stanford.edu/*raft*.pdf. Reading this paper should 
> clarify most of your confusion regarding what Zookeeper achieves at its very core.
> 

ZooKeeper isn't based on Raft, it uses Zab. If you're interested in the space of replication protocols, then reading the Paxos papers and others including Raft makes sense.

> 
> Cheers,
> 
> Martin (Kersten)
> 
> 2015-08-30 17:47 GMT+02:00 Prabhjot Bharaj <pr...@gmail.com>:
> 
>> Hello Folks,
>> 
>> I am going through zookeeper internals described here:
>> http://zookeeper.apache.org/doc/r3.4.6/zookeeperInternals.html
>> 
>> I have some very basic doubts in understanding the Gurantees - 
>> *Reliable delivery, **Total order *and *Causal order*
>> 
>> 1. I do not understand the term - 'delivery' and 'order' in these sections.
>>   a) Delivery - Does 'delivery' refer to delivery of messages from 
>> server to server or server to client ?
>>   b) Order - As per this link:
>> https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos, 
>> state updates must be ordered - What kind of state updates are these 
>> ? Does the term - 'order' in this link and the one shared in the top 
>> of this email have the same meaning ?
>> 
>> 2. *'**If a message, m, is delivered by one server, it will be 
>> eventually delivered by all servers.'* - delivered <from what> <to what> ?
>> 
>> 3. If a and b are delivered messages, either a will be delivered 
>> before b or b will be delivered before a -- dont really understand what this means !
>> 
>> 4. the terms sender - Does sender classify as one of the zookeeper 
>> servers in the cluster or the client ?
>> 
>> 
>> Request you to share your knowledge on my doubts so I can learn more 
>> on the internals and be able to use zookeeper effectively
>> 
>> Thanks,
>> Prabhjot
>> 


Re: Doubt in Atomic Broadcast

Posted by Flavio Junqueira <fp...@yahoo.com.INVALID>.
Thanks for the insight, Martin.

On 30 Aug 2015, at 18:20, Martin Kersten <ma...@gmail.com> wrote:
> 
> Hi,
> 
>   Zookeeper is all about a shared state called a consensus.

Consensus in the context of zookeeper is about agreeing on state. 

> So everything
> that it is at its core is providing any means of joining a group of servers
> and elect a leader and share information that result in a predictable
> shared state that all servers agree on.
> 

There is a distinction between clients and servers. Client connect to an ensemble and submit requests. The requests that update the state are replicated to make sure that the replicas remain consistent.

As for predictability, I think you're referring to consistency. There are too many possible issues in a distributed system that make predictability really hard if not impossible.

> The most popular consensus algorithm is the Raft algorithm:
> https://ramcloud.stanford.edu/*raft*.pdf. Reading this paper should clarify
> most of your confusion regarding what Zookeeper achieves at its very core.
> 

ZooKeeper isn't based on Raft, it uses Zab. If you're interested in the space of replication protocols, then reading the Paxos papers and others including Raft makes sense.

> 
> Cheers,
> 
> Martin (Kersten)
> 
> 2015-08-30 17:47 GMT+02:00 Prabhjot Bharaj <pr...@gmail.com>:
> 
>> Hello Folks,
>> 
>> I am going through zookeeper internals described here:
>> http://zookeeper.apache.org/doc/r3.4.6/zookeeperInternals.html
>> 
>> I have some very basic doubts in understanding the Gurantees - *Reliable
>> delivery, **Total order *and *Causal order*
>> 
>> 1. I do not understand the term - 'delivery' and 'order' in these sections.
>>   a) Delivery - Does 'delivery' refer to delivery of messages from server
>> to server or server to client ?
>>   b) Order - As per this link:
>> https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos, state
>> updates must be ordered - What kind of state updates are these ? Does the
>> term - 'order' in this link and the one shared in the top of this email
>> have the same meaning ?
>> 
>> 2. *'**If a message, m, is delivered by one server, it will be eventually
>> delivered by all servers.'* - delivered <from what> <to what> ?
>> 
>> 3. If a and b are delivered messages, either a will be delivered before b
>> or b will be delivered before a -- dont really understand what this means !
>> 
>> 4. the terms sender - Does sender classify as one of the zookeeper servers
>> in the cluster or the client ?
>> 
>> 
>> Request you to share your knowledge on my doubts so I can learn more on the
>> internals and be able to use zookeeper effectively
>> 
>> Thanks,
>> Prabhjot
>> 


Re: Doubt in Atomic Broadcast

Posted by Martin Kersten <ma...@gmail.com>.
Hi,

   Zookeeper is all about a shared state called a consensus. So everything
that it is at its core is providing any means of joining a group of servers
and elect a leader and share information that result in a predictable
shared state that all servers agree on.

The most popular consensus algorithm is the Raft algorithm:
https://ramcloud.stanford.edu/*raft*.pdf. Reading this paper should clarify
most of your confusion regarding what Zookeeper achieves at its very core.


Cheers,

Martin (Kersten)

2015-08-30 17:47 GMT+02:00 Prabhjot Bharaj <pr...@gmail.com>:

> Hello Folks,
>
> I am going through zookeeper internals described here:
> http://zookeeper.apache.org/doc/r3.4.6/zookeeperInternals.html
>
> I have some very basic doubts in understanding the Gurantees - *Reliable
> delivery, **Total order *and *Causal order*
>
> 1. I do not understand the term - 'delivery' and 'order' in these sections.
>    a) Delivery - Does 'delivery' refer to delivery of messages from server
> to server or server to client ?
>    b) Order - As per this link:
> https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos, state
> updates must be ordered - What kind of state updates are these ? Does the
> term - 'order' in this link and the one shared in the top of this email
> have the same meaning ?
>
> 2. *'**If a message, m, is delivered by one server, it will be eventually
> delivered by all servers.'* - delivered <from what> <to what> ?
>
> 3. If a and b are delivered messages, either a will be delivered before b
> or b will be delivered before a -- dont really understand what this means !
>
> 4. the terms sender - Does sender classify as one of the zookeeper servers
> in the cluster or the client ?
>
>
> Request you to share your knowledge on my doubts so I can learn more on the
> internals and be able to use zookeeper effectively
>
> Thanks,
> Prabhjot
>

Re: Doubt in Atomic Broadcast

Posted by Flavio Junqueira <fp...@apache.org>.
Hi Prabhjot,

See some comments inlined:

> On 30 Aug 2015, at 16:47, Prabhjot Bharaj <pr...@gmail.com> wrote:
> 
> Hello Folks,
> 
> I am going through zookeeper internals described here:
> http://zookeeper.apache.org/doc/r3.4.6/zookeeperInternals.html
> 
> I have some very basic doubts in understanding the Gurantees - *Reliable
> delivery, **Total order *and *Causal order*
> 

Yeah, that discussion is a bit outdated, I haven't at it in a while and I cans ee that it can certainly be improved. This is referring to the guarantees of the delivery of state updates for the internal replication protocol. 

> 1. I do not understand the term - 'delivery' and 'order' in these sections.
>   a) Delivery - Does 'delivery' refer to delivery of messages from server
> to server or server to client ?

Delivery is referring to the replication protocol of the servers, so the delivery refers to servers delivering state updates. A simple way of thinking about this is the following. The zookeeper servers implement an application, which is a data tree of znodes. The servers rely on a replication protocol to guarantee that the state of the data tree across nodes is consistent, but they implement the replication protocol themselves. For abstraction purposes, the protocol takes proposals (of state updates) and delivers the update once there is agreement.   

>   b) Order - As per this link:
> https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos, state
> updates must be ordered - What kind of state updates are these ? Does the
> term - 'order' in this link and the one shared in the top of this email
> have the same meaning ?

State updates are updates to the zookeeper data tree. Order here refers to the order in which the state updates are delivered to the data tree in a server. 

> 2. *'**If a message, m, is delivered by one server, it will be eventually
> delivered by all servers.'* - delivered <from what> <to what> ?
> 

This is again about the replication protocol. If you think of the broadcast primitive the replication of zookeeper relies upon as a black box, then you have roughly two calls: propose and deliver. A propose call takes a state update while a deliver call is an upcall that is invoked when the ensemble has agreed that the state update is ready to be delivered (to the data tree application). Only the leader is allowed to propose.

> 3. If a and b are delivered messages, either a will be delivered before b
> or b will be delivered before a -- dont really understand what this means !
> 

Messages a and b refer to messages.

> 4. the terms sender - Does sender classify as one of the zookeeper servers
> in the cluster or the client ?
> 
> 

Sender in this context is a zookeeper server.

> Request you to share your knowledge on my doubts so I can learn more on the
> internals and be able to use zookeeper effectively
> 

You probably don't need to understand the internals to use it effectively, but learning is surely fine if that's what you want to do.

-Flavio