在Distributed locks with Redis Redis - Retry on failure中,它说:
When a client is unable to acquire the lock, it should try again after a random delay in order to try to desynchronize multiple clients trying to acquire the lock for the same resource at the same time (this may result in a split brain condition where nobody wins). Also the faster a client tries to acquire the lock in the majority of Redis instances, the smaller the window for a split brain condition (and the need for a retry), so ideally the client should try to send the SET commands to the N instances at the same time using multiplexing.
我的疑问
- “this may result in a split brain condition where nobody wins”,究竟是什么会造成 split brain condition 呢?
- “Also the faster a client tries to acquire the lock in the majority of Redis instances, the smaller the window for a split brain condition (and the need for a retry)”,为什么 client 越快尝试获取,split brain condition 发生的机率就越小呢?
- “so ideally the client should try to send the SET commands to the N instances at the same time using multiplexing”,Distributed locks with Redis Redis - The Redlock algorithm不是说“It tries to acquire the lock in all the N instances sequentially”,为什么这里就变成了“at the same time”?
