I did a simple test: two redis instances at the same machine. One is slave and the other is master.
If I send the INFO command to the Master, I get the following:
slave0:127.0.0.1,37479,online
Then, I froze the slave process (with "kill -STOP <pid>") and waited a LONG time, like 15 minutes.
The INFO command on the Master redis-server was still showing "online".
I have noticed that there is no way for me to know if the master redis-server thinks that the slave redis-server is up or down, since the INFO string fills the status lik this:
switch(slave->replstate) {
case REDIS_REPL_WAIT_BGSAVE_START:
case REDIS_REPL_WAIT_BGSAVE_END:
state = "wait_bgsave";
break;
case REDIS_REPL_SEND_BULK:
state = "send_bulk";
break;
case REDIS_REPL_ONLINE:
state = "online";
break;
}
Am I missing something? Is there a way to know if the Master detected that the Slave is down other then the INFO output?