﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Howard Pinsley commented on Break the algorithm: Distributed Lock</title><description>Actually, now that I think about it, since you want a majority for quorum, it probably should be:
  
  
return successfulLocks &gt;= (topology.Count / 2) + 1
  
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment14</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment14</guid><pubDate>Tue, 08 Sep 2009 23:09:55 GMT</pubDate></item><item><title>Ayende Rahien commented on Break the algorithm: Distributed Lock</title><description>Howard,
  
I would like to deal with even number of servers, yes.
  
But you are right, your code is simpler, much simpler.
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment13</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment13</guid><pubDate>Tue, 08 Sep 2009 14:04:37 GMT</pubDate></item><item><title>Howard Pinsley commented on Break the algorithm: Distributed Lock</title><description>Ayende:
  
  
I'm confused by this line:
  
  
return (successfulLocks/2) &gt;= (topology.Count/2) 
  
  
Why is it not
  
return successfulLocks &gt;= (topology.Count/2) 
  
  
Are you somehow trying to deal with and even number of servers?
  
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment12</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment12</guid><pubDate>Tue, 08 Sep 2009 12:51:31 GMT</pubDate></item><item><title>Alex Yakunin commented on Break the algorithm: Distributed Lock</title><description>&gt; The annoying thing is that we need to recover from situations in which some of the nodes holding the key are down or inaccessible.
  
  
Ah, I see... That's the most complex problem. Check out the links ;)
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment11</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment11</guid><pubDate>Sun, 06 Sep 2009 15:57:44 GMT</pubDate></item><item><title>Alex Yakunin commented on Break the algorithm: Distributed Lock</title><description>&gt; Don't at least n/2+1 servers need to return success in order for the lock to be considered as 'entered'?
  
  
As far as I can judge from above, there is no code related to distributed consensus. So no any "global" state guarantees. Thus it's difficult to judge if this will work at all: no one can predict how such a system will work after failure, because state of recovered node initially can be completely unexpected.
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment10</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment10</guid><pubDate>Sun, 06 Sep 2009 15:54:45 GMT</pubDate></item><item><title>Alex Yakunin commented on Break the algorithm: Distributed Lock</title><description>P.S. For me the worst issues here are:
  
- Operations aren't atomic. Its completely unclear what guarantees are you going to provide after their completion.
  
-There must be issues related to difference in time
  
- Its completely unclear what will happen when new server wakes up after temporary failure (e.g. network outage).
  
- It is unclear how they're classified as down / working. What invariants are guaranteed to be maintained?
  
  
P.S. One more good article to read is Microsoft Boxwood project description.
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment9</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment9</guid><pubDate>Sun, 06 Sep 2009 15:49:28 GMT</pubDate></item><item><title>Alex Yakunin commented on Break the algorithm: Distributed Lock</title><description>Oren, I'd recommend you to read about Chubby &amp; distributed consensus algorithms (Paxos, etc.). You'll see principal issues, rather than just technical.
  
  
Btw, we evaluated DHT approach for distributed storage for DO databases. And finally decided this approach won't work for storages we typically need: index seek can't beimplemented there well, but this is essential in quite many cases. 
  
  
Note that e.g. BigTable is not DHT.
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment8</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment8</guid><pubDate>Sun, 06 Sep 2009 11:13:02 GMT</pubDate></item><item><title>Ayende Rahien commented on Break the algorithm: Distributed Lock</title><description>Uriel,
  
I love Boo for its clean syntax.
  
It is almost pseudo code
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment7</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment7</guid><pubDate>Sat, 05 Sep 2009 21:59:43 GMT</pubDate></item><item><title>Justin Chase commented on Break the algorithm: Distributed Lock</title><description>That looks more like boo than psuedo code :-P
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment6</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment6</guid><pubDate>Sat, 05 Sep 2009 18:09:39 GMT</pubDate></item><item><title>Uriel Katz commented on Break the algorithm: Distributed Lock</title><description>what interest me is that your pseudo is in Boo/Python(or really close to it) :)
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment5</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment5</guid><pubDate>Sat, 05 Sep 2009 17:17:27 GMT</pubDate></item><item><title>Jason commented on Break the algorithm: Distributed Lock</title><description>As I understand it, the Chubby service associates a number that is incremented for locking requests. It's a variant of the Paxos algorithm and the number is needed to form a consensus on who owns the lock. 
  
  
That may be overkill for this use, but I think the idea is if you need to change something in the DHT from one state to the next, this gives you some 'consensus' of the 'start state' before you begin.
  
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment4</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment4</guid><pubDate>Sat, 05 Sep 2009 15:52:39 GMT</pubDate></item><item><title>Ayende Rahien commented on Break the algorithm: Distributed Lock</title><description>Jason,
  
You are probably right. 
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment3</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment3</guid><pubDate>Sat, 05 Sep 2009 15:42:30 GMT</pubDate></item><item><title>Ayende Rahien commented on Break the algorithm: Distributed Lock</title><description>What do you mean by automatically incrementing the lock revision?
  
Can you explain?
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment2</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment2</guid><pubDate>Sat, 05 Sep 2009 15:42:28 GMT</pubDate></item><item><title>Jason commented on Break the algorithm: Distributed Lock</title><description>Don't at least n/2+1 servers need to return success in order for the lock to be considered as 'entered'? Otherwise two nodes could enter the lock, each with half the nodes.
  
  
This is sort of like the Google Chubby protocol. They use a lock revision # that is incremented 'atomically' across nodes to ensure that two nodes can't lock on the same key.
</description><link>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment1</link><guid>http://ayende.com/4175/break-the-algorithm-distributed-lock#comment1</guid><pubDate>Sat, 05 Sep 2009 14:23:30 GMT</pubDate></item></channel></rss>