Skip to content

Commit c72253e

Browse files
oranagraantirez
authored andcommitted
fixes to diskless replication.
master was closing the connection if the RDB transfer took long time. and also sent PINGs to the slave before it got the initial ACK, in which case the slave wouldn't be able to find the EOF marker.
1 parent 83eb5e7 commit c72253e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/networking.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int prepareClientToWrite(redisClient *c) {
134134
if (c->fd <= 0) return REDIS_ERR; /* Fake client */
135135
if (c->bufpos == 0 && listLength(c->reply) == 0 &&
136136
(c->replstate == REDIS_REPL_NONE ||
137-
c->replstate == REDIS_REPL_ONLINE) &&
137+
c->replstate == REDIS_REPL_ONLINE) && !c->repl_put_online_on_ack &&
138138
aeCreateFileEvent(server.el, c->fd, AE_WRITABLE,
139139
sendReplyToClient, c) == AE_ERR) return REDIS_ERR;
140140
return REDIS_OK;

src/replication.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type) {
768768
* is technically online now. */
769769
slave->replstate = REDIS_REPL_ONLINE;
770770
slave->repl_put_online_on_ack = 1;
771+
slave->repl_ack_time = server.unixtime;
771772
} else {
772773
if (bgsaveerr != REDIS_OK) {
773774
freeClient(slave);

0 commit comments

Comments
 (0)