How to Do Distributed Locking (2016)

How to Do Distributed Locking (2016)

In this context, a fencing token is simply a number that increases (e.g. incremented by the lock service) every time a client acquires the lock. For example, if you are using ZooKeeper as lock service, you can use the or the znode version number as fencing token, and you’re in good shape [3]. The fact that Redlock fails to generate fencing tokens should already be sufficient reason not to use it in situations where correctness depends on the lock.

Source: martin.kleppmann.com