Skip to content

Commit

Permalink
replicationHandleMasterDisconnection() belongs to replication.c.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jul 28, 2015
1 parent 54c71f2 commit 278ea9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,20 +674,6 @@ void disconnectSlaves(void) {
}
}

/* This function is called when the slave lose the connection with the
* master into an unexpected way. */
void replicationHandleMasterDisconnection(void) {
server.master = NULL;
server.repl_state = REPL_STATE_CONNECT;
server.repl_down_since = server.unixtime;
/* We lost connection with our master, force our slaves to resync
* with us as well to load the new data set.
*
* If server.masterhost is NULL the user called SLAVEOF NO ONE so
* slave resync is not needed. */
if (server.masterhost != NULL) disconnectSlaves();
}

void freeClient(client *c) {
listNode *ln;

Expand Down
14 changes: 14 additions & 0 deletions src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,20 @@ void replicationUnsetMaster(void) {
server.repl_state = REPL_STATE_NONE;
}

/* This function is called when the slave lose the connection with the
* master into an unexpected way. */
void replicationHandleMasterDisconnection(void) {
server.master = NULL;
server.repl_state = REPL_STATE_CONNECT;
server.repl_down_since = server.unixtime;
/* We lost connection with our master, force our slaves to resync
* with us as well to load the new data set.
*
* If server.masterhost is NULL the user called SLAVEOF NO ONE so
* slave resync is not needed. */
if (server.masterhost != NULL) disconnectSlaves();
}

void slaveofCommand(client *c) {
/* SLAVEOF is not allowed in cluster mode as replication is automatically
* configured using the current address of the master node. */
Expand Down

0 comments on commit 278ea9d

Please sign in to comment.