Why failover-based implementations are not enough

Distributed locks with Redis – Redis https://redis.io/topics/distlockredis

There is an obvious race condition with this model:ui

  1. Client A acquires the lock in the master.
  2. The master crashes before the write to the key is transmitted to the slave.
  3. The slave gets promoted to master.
  4. Client B acquires the lock to the same resource A already holds a lock for. SAFETY VIOLATION!
相關文章
相關標籤/搜索