Avoid installing the client write handler when possible.

This commit is contained in:
antirez
2015-09-28 18:25:57 +02:00
parent d1b6a17d1e
commit 1c7d87df0c
4 changed files with 56 additions and 7 deletions

View File

@ -1857,6 +1857,12 @@ void replicationCacheMaster(client *c) {
serverAssert(ln != NULL);
listDelNode(server.clients,ln);
/* Remove from the list of clients with pending writes as well. */
if (c->flags & CLIENT_PENDING_WRITE) {
ln = listSearchKey(server.clients_pending_write,c);
if (ln) listDelNode(server.clients_pending_write,ln);
}
/* Save the master. Server.master will be set to null later by
* replicationHandleMasterDisconnection(). */
server.cached_master = server.master;