Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
466c277b
Commit
466c277b
authored
Sep 27, 2018
by
Andrey Bugaevskiy
Browse files
Move child termination to readSyncBulkPayload
parent
98a64523
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
466c277b
...
@@ -1245,6 +1245,12 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
...
@@ -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) {
...
@@ -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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment