minio / dsync

A distributed sync package.
Apache License 2.0
400 stars 41 forks source link

README: Don't recommend redis distlock #29

Closed dgryski closed 8 years ago

dgryski commented 8 years ago

Distlock is not a safe distributed locking algorithm.

http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html

harshavardhana commented 8 years ago

http://antirez.com/news/101 - looks like the jury is out there?

dgryski commented 8 years ago

While Antirez has shown himself to be an excellent C programmer, he's a poor distributed system engineer. Martin Kleppmann is a distributed system researcher at Cambridge. I'm likely to trust his analysis more.

maximecaron commented 8 years ago

Another common way to implement distributed lock is to simply use Lease. Xtreemfs use the FLease algorithm that is a Lease built on top of Paxos register: http://www.xtreemfs.org/publications/flease_paper_ipdps.pdf

The main difference I see is that stale lock are automatically released if the server can't renew the lease in time. Also the state change is linearizable and crash resistant.

fwessels commented 8 years ago

We are not "recommending" redislock, it is just another approach that may work for some in some cases and not in other cases.

It is not meant to be a conclusive list, for sure there will be other approaches as well.