Redis Synchronous replication failure scenarios

旧城冷巷雨未停 提交于 2021-01-04 05:45:23

问题


In redis cluster specification here https://redis.io/topics/cluster-tutorial it mentions

    however note that Redis Cluster does not implement strong consistency even when synchronous replication is used: 
it is always possible under more complex failure scenarios that a slave that was not able to receive the write is elected as master.

If I issue WAIT command with

WAIT 0 <No.Of Salves>

then I am forcing at the expense of availability to write data in all the slaves. Could you explain me in this scenario how can synchronous replication doesn't meet consistency requirements as mentioned above https://redis.io/topics/cluster-tutorial

Specifically I want to understand the complex failure scenarios that a slave that was not able to receive the write is elected as master when I issue WAIT 0 <No.OfSlaves>


回答1:


Master node might fail before WAIT returns, i.e. write operations haven't been replicated to all slaves. In this case, some slaves have already synced these write operations, while other haven't. When Redis Cluster tries to elect a new master, it might elect a slave, which haven't been fully synced, and the write is lost forever.

Even if the write operations have been fully synced to all slaves, and one of these slave has been elected as the new master, these write operations might be lost. For example, if the new master is restarted before it dumps these write operations to disk. If this new master comes back before a new election triggered, these write operations have been lost.



来源:https://stackoverflow.com/questions/57349100/redis-synchronous-replication-failure-scenarios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!