mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Move child termination to readSyncBulkPayload
This commit is contained in:
parent
98a64523c4
commit
466c277b4f
@ -1245,6 +1245,12 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
|
|||||||
if (eof_reached) {
|
if (eof_reached) {
|
||||||
int aof_is_enabled = server.aof_state != AOF_OFF;
|
int aof_is_enabled = server.aof_state != AOF_OFF;
|
||||||
|
|
||||||
|
/* Ensure background save doesn't overwrite synced data */
|
||||||
|
if (server.rdb_child_pid != -1) {
|
||||||
|
kill(server.rdb_child_pid,SIGUSR1);
|
||||||
|
rdbRemoveTempFile(server.rdb_child_pid);
|
||||||
|
}
|
||||||
|
|
||||||
if (rename(server.repl_transfer_tmpfile,server.rdb_filename) == -1) {
|
if (rename(server.repl_transfer_tmpfile,server.rdb_filename) == -1) {
|
||||||
serverLog(LL_WARNING,"Failed trying to rename the temp DB into dump.rdb in MASTER <-> REPLICA synchronization: %s", strerror(errno));
|
serverLog(LL_WARNING,"Failed trying to rename the temp DB into dump.rdb in MASTER <-> REPLICA synchronization: %s", strerror(errno));
|
||||||
cancelReplicationHandshake();
|
cancelReplicationHandshake();
|
||||||
@ -1814,13 +1820,6 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stop background saving for obsolete database state. */
|
|
||||||
server.dirty = 0;
|
|
||||||
if (server.rdb_child_pid != -1) {
|
|
||||||
kill(server.rdb_child_pid,SIGUSR1);
|
|
||||||
rdbRemoveTempFile(server.rdb_child_pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Prepare a suitable temp file for bulk transfer */
|
/* Prepare a suitable temp file for bulk transfer */
|
||||||
while(maxtries--) {
|
while(maxtries--) {
|
||||||
snprintf(tmpfile,256,
|
snprintf(tmpfile,256,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user