http://redis.io/topics/distlock
article-redlock#min-guarantees1
Safety property: Mutual exclusion. At any given moment, only one client can hold a lock.
Liveness property A: Deadlock free. Eventually it is always possible to acquire a lock, even if the client that locked a resource crashed or gets partitioned.
Liveness property B: Fault tolerance. As long as the majority of Redis nodes are up, clients are able to acquire and release locks.
article-redlock#min-guarantees1
every lock is "signed" with a random string, so the lock will be removed only if it is still the one that was set by the client trying to remove it.
The time we use as the key time to live, is called the "lock validity time". It is both the auto release time, and the time the client has in order to perform the operation required before another client may be able to acquire the lock again, without technically violating the mutual exclusion guarantee, which is only limited to a given window of time from the moment the lock is acquired.
Lock validity time
paper-leases-efficient-cache-consistency
At the end, refers to blog-post-how-to-do-distributed-locking