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: [email protected] [mailto:[email protected]] 
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.


[email protected]

Reply via email to