Unverified Commit 76415fa2 authored by debing.sun's avatar debing.sun Committed by GitHub
Browse files

Prevent deleting RDB read event after restarting RDB saving for other diskless replicas (#13410)

When we terminate the diskless RDB saving child process and, at the same
time, we start a new BGSAVE for new replicas, we should not delete the
RDB read event. Otherwise, these replicas will never receive a response.
this is a result of the recent change in
https://github.com/redis/redis/pull/13361



---------
Co-authored-by: default avataroranagra <oran@redislabs.com>
parent 7d3545cb
...@@ -1568,12 +1568,14 @@ void rdbPipeReadHandler(struct aeEventLoop *eventLoop, int fd, void *clientData, ...@@ -1568,12 +1568,14 @@ void rdbPipeReadHandler(struct aeEventLoop *eventLoop, int fd, void *clientData,
if (stillAlive == 0) { if (stillAlive == 0) {
serverLog(LL_WARNING,"Diskless rdb transfer, last replica dropped, killing fork child."); serverLog(LL_WARNING,"Diskless rdb transfer, last replica dropped, killing fork child.");
/* Avoid deleting events after killRDBChild as it may trigger new bgsaves for other replicas. */
aeDeleteFileEvent(server.el, server.rdb_pipe_read, AE_READABLE);
killRDBChild(); killRDBChild();
break;
} }
/* Remove the pipe read handler if at least one write handler was set. */ /* Remove the pipe read handler if at least one write handler was set. */
if (server.rdb_pipe_numconns_writing || stillAlive == 0) { else if (server.rdb_pipe_numconns_writing) {
if (server.rdb_pipe_read != -1) aeDeleteFileEvent(server.el, server.rdb_pipe_read, AE_READABLE);
aeDeleteFileEvent(server.el, server.rdb_pipe_read, AE_READABLE);
break; break;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment