summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2015-04-01 09:43:34 +0200
committerSalvatore Sanfilippo <antirez@gmail.com>2015-04-01 09:43:34 +0200
commitd5a35c39468f7a8d1890ee61070d68a1e3a5cda1 (patch)
treedc134145741ff0e94adc2167447c49cf16b4a2fb
parent386804246f35e27a8db0d31fd0badd85cc6ecc04 (diff)
parent159875b5a3a8dd7780aadbf1f7674061fc760920 (diff)
downloadredis-d5a35c39468f7a8d1890ee61070d68a1e3a5cda1.tar.gz
Merge pull request #2485 from oranagra/diskless-repl-fixes
fixes to diskless replication.
-rw-r--r--src/networking.c2
-rw-r--r--src/replication.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/networking.c b/src/networking.c
index a2d80adf3..3b4f3b0fe 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -149,7 +149,7 @@ int prepareClientToWrite(redisClient *c) {
if (c->fd <= 0) return REDIS_ERR; /* Fake client */
if (c->bufpos == 0 && listLength(c->reply) == 0 &&
(c->replstate == REDIS_REPL_NONE ||
- c->replstate == REDIS_REPL_ONLINE) &&
+ c->replstate == REDIS_REPL_ONLINE) && !c->repl_put_online_on_ack &&
aeCreateFileEvent(server.el, c->fd, AE_WRITABLE,
sendReplyToClient, c) == AE_ERR) return REDIS_ERR;
return REDIS_OK;
diff --git a/src/replication.c b/src/replication.c
index afea75b6a..c01cd52e6 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -773,6 +773,7 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type) {
* is technically online now. */
slave->replstate = REDIS_REPL_ONLINE;
slave->repl_put_online_on_ack = 1;
+ slave->repl_ack_time = server.unixtime;
} else {
if (bgsaveerr != REDIS_OK) {
freeClient(slave);