On 6/24/2011 2:09 PM, Jim Newsham wrote:
On 6/24/2011 9:28 AM, Yang wrote:
without a clear description of your pseudo-code, it's difficult to say whether it will work.

but I think it can work fine as an election/agreement protocol, which you can use as a lock to some degree, but this requires all the potential lock contenders to all participate, you can't grab a lock before everyone has voiced their vote yet

I agree with this statement. I think the issue is that the timestamps are generated by the clients and their clocks may not be in sync, so write A from client A might arrive with timestamp T, and write B from client B may reach the node later in time, however it may have an earlier timestamp (T', where T' < T). Client A may perform a read immediately after its write and notice that it was the only client to request a lock -- so it will assume it has acquired the lock. After Client B's lock request, it will perform a read and observe that it has written the request with the earliest timestamp -- so it will also assume it has acquired the lock, which would result in a failure of the locking scheme. If each client is required to wait for all other clients to "vote", then this issue goes away.


Yes, you both understand the problem. Hopefully we can find a solution without relying on a hack and based on C* design that will be supported in the future.

I'll be thinking on this some more.  Thanks.

Reply via email to