min-slaves-to-write: don't accept writes with less than N replicas.

This feature allows the user to specify the minimum number of
connected replicas having a lag less or equal than the specified
amount of seconds for writes to be accepted.
This commit is contained in:
antirez
2013-05-29 11:36:44 +02:00
parent fc2587ec6e
commit d0d67f8d42
6 changed files with 77 additions and 2 deletions

View File

@ -692,6 +692,7 @@ void freeClient(redisClient *c) {
* backlog. */
if (c->flags & REDIS_SLAVE && listLength(server.slaves) == 0)
server.repl_no_slaves_since = server.unixtime;
refreshGoodSlavesCount();
}
/* Case 2: we lost the connection with the master. */