I need to load static data one time in redis in the master node and only when the synchronization is finished for all slaves I am going to be able to read. This is because we are going to have a lot reading and a few writing, and the data is not going to change for a long time.
WAIT implements synchronous replication for Redis. Synchronous replication is required but not sufficient in order to achieve strong consistency. Strong consistency is practically the sum of two things:
Synchronous replication to the majority of nodes on a distributed system.
A way to orchestrate change of leadership (failover basically) so that it is guaranteed that only a node preserving the full history of acknowledged operations in the previous leader can be elected.
WAIT does not provide “2”. The replication process in Redis is performed by Sentinel or Redis Cluster, and is not able to provide property 2 (since the synchronous replication in Redis is the exception not the rule, so there was no much focus on that aspect). However what Redis replication does is to attempt to promote the slave that appears to preserve the greatest amount of data . While this does not change the theoretical guarantees of Redis failover, that can still lose acknowledged writes, it means that if you use WAIT , there are more slaves having a given operation into their memory, and in turn it is a lot more likely that in the event of a failover, the operation will be retained. However while this will make a failure mode that discards the acknowledged operation hard to trigger, there always exists a failure mode with this properties.
TLDR:WAIT does not make Redis linearizable, what it does is to make sure the specified number of slaves will receive the write, that in turn makes failover more robust, but without any hard guarantee.
is It possible to disable automatic failover ? is there a way to know when master got failover state ? because in this case we prefer to check consistency or initialize master node.
There are very few distributed database systems that implement perfect consistency. To get that, you generally need a proven consistency protocol such as Raft. (See RedisRaft, for example).
Are there failure scenarios where the WAIT strategy will succeed in spite of actual data loss? Yes, certainly there are. But this is true of most database. See the Jepsen analyses for a through treatment of this: Analyses