zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh R <rake...@huawei.com>
Subject RE: RE: A question about sequential order consistency that zookeeper garantees
Date Thu, 23 Oct 2014 05:35:26 GMT

Yes.

-Rakesh

From: bit1129@163.com [mailto:bit1129@163.com]
Sent: 23 October 2014 10:43
To: Rakesh R
Subject: Re: RE: A question about sequential order consistency that zookeeper garantees

Thanks Rakesh for the quick reply. So, I understand that the time that clients send the request
doesn't matter,but the server will "queue" the request and process the request.



________________________________
bit1129@163.com<mailto:bit1129@163.com>

From: Rakesh R<mailto:rakeshr@huawei.com>
Date: 2014-10-23 12:33
To: user@zookeeper.apache.org<mailto:user@zookeeper.apache.org>; bit1129@163.com<mailto:bit1129@163.com>
Subject: RE: A question about sequential order consistency that zookeeper garantees
Hi,

Sequential Order Guarantee:
---------------------------

Server view:- It will process the requests in sequential fashion.

Say, there are two clients connected with the server, client-1 and client-2.
Assume application had created a znode /myapp and there is a logic to do distributed locking
mechanism. Now both these clients will try to acquire lock by creating '/myapp/lock' znode.
I'm calling these requests as request-1(create /myapp/lock) and request-2(create /myapp/lock).
Again assume, server receives the requests in the order of request-2 and then request-1. For
simplicity, you can imagine there is a Queue maintained at the server and all these requests
will be put into this Queue and executes in FIFO order. First, server will pick request-2
and creates /myapp/lock znode. Also, it will send watcher notifications if anyone has registered.
Then move on to the next request-2(create /myapp/lock), while executing this will throw exception
saying NodeExistsException.

ZooKeeper maintains global ordering but how? - Every write is assigned a globally unique id,
sequentially ordered identifier called a zxid, or ZooKeeper transaction id. This guarantees
a global order to all updates in a ZooKeeper ensemble.


Regards,
Rakesh
-----Original Message-----
From: bit1129@163.com<mailto:bit1129@163.com> [mailto:bit1129@163.com]
Sent: 23 October 2014 08:46
To: user
Subject: A question about sequential order consistency that zookeeper garantees

Hi,Zookeepers,

I'd like to ask a question about sequential order consistency that zookeeper garantees.

Say, 2 zookeeper clients want to update the same znode data one after the other.Client1 sends
the request 1 second before Client2.
What would be the end result? There is no order gurantee here, dure to network delay, it is
likely that clients1 send the request before client2, but the zookeeper servers first execute
the request from Client1 before client2

If this is not what sequential order consistency means, then what exactly does sequential
order consistencymeans, what does zookeeper exactly garantee?

Thanks.


bit1129@163.com<mailto:bit1129@163.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message