不太理解 Redlock 算法中 split brain 相关内容
时间: 2020-08-21来源:V2EX
前景提要
在 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”?

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行