summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-08-06 15:08:54 +0200
committerantirez <antirez@gmail.com>2015-08-21 15:31:59 +0200
commit12d2a89410e1059831bd0d2014f2cd70ce2ebec3 (patch)
treebe036ed8852fae32a60b0c27599e505b501f4b13
parent7a0267709719eda2b42ceda1b93cb329ccea3e1d (diff)
downloadredis-12d2a89410e1059831bd0d2014f2cd70ce2ebec3.tar.gz
flushSlavesOutputBuffers(): details clarified via comments.
Talking with @oranagra we had to reason a little bit to understand if this function could ever flush the output buffers of the wrong slaves, having online state but actually not being ready to receive writes before the first ACK is received from them (this happens with diskless replication). Next time we'll just read this comment.
-rw-r--r--src/networking.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c
index 2e722ec69..a5f06e858 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -1622,6 +1622,12 @@ void flushSlavesOutputBuffers(void) {
redisClient *slave = listNodeValue(ln);
int events;
+ /* Note that the following will not flush output buffers of slaves
+ * in STATE_ONLINE but having put_online_on_ack set to true: in this
+ * case the writable event is never installed, since the purpose
+ * of put_online_on_ack is to postpone the moment it is installed.
+ * This is what we want since slaves in this state should not receive
+ * writes before the first ACK. */
events = aeGetFileEvents(server.el,slave->fd);
if (events & AE_WRITABLE &&
slave->replstate == REDIS_REPL_ONLINE &&