WAIT implements synchronous replication for Redis. Synchronous replication is necessary, but not enough to achieve strong consistency. A strong consistency is almost the sum of two things:
- Synchronous replication of most nodes in a distributed system.
- A way to manage leadership change (mainly with rollback) so that it is guaranteed that only node can be selected, keeping the entire history of confirmed operations in the previous leader.
WAIT does not provide "2". The replication process in Redis is done using Sentinel or Redis Cluster and cannot provide property 2 (since synchronous replication in Redis is an exception, not a rule, so there was not much attention to this aspect). However, Redis replication is attempting to promote a slave device that appears to store the most data. Although this does not change the theoretical guarantees of Redis refusal, which can still lose confirmed records, this means that if you use WAIT , there will be more subordinates with the specified operation in their memory, and in turn, this is much more likely that if you switch to another resource operation will be saved. However, while this will make a failure mode that resets the confirmed operation, which is difficult to call, there always exists a failure mode with these properties.
TL; DR: WAIT does not redisify what it does to make sure that the specified number of subordinates will receive a record, which in turn makes the transition to another resource more reliable, but without any guarantee.
source share