So i did some chaos test for our redis cluster and i disabled both RDB & AOF. So after i kill the master, the slave failover it, and after the old master reconnect, it correctly follow his new master and request a full sync. However, after it received the RDB file from the network, it serve the client while loading the RDB. So it's serving partial data to the client.

In my environment i enabled slave read, and in this case, i might get empty response from a still loading slave even if the data actually existed. I am wondering can i fix this by some configuration?

Comment From: madolson

The replication phase is comprised of two parts. The master will take a full snapshot of the data and transfer that, and then send any writes it accumulated during the snapshot. While a replica is loading the snapshot, it should return a "-LOADING" error, and not return any data. However, while it's loading the accumulated writes, it may return very stale data. There is no way to address this second part today.

Comment From: smartnews-weitao

Thx for the reply, i am wondering is "return LOADING error during loading the snapshot" the default behavior or do i need to turn on some configuration to enable this?

Comment From: madolson

Yes, that is the default behavior. Maybe unless you are running a very old version; https://github.com/redis/redis/blob/unstable/src/server.c#L4080