diff options
author | antirez <antirez@gmail.com> | 2015-07-28 14:36:50 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-08-20 10:19:10 +0200 |
commit | 5a9bc7cc1043911ecaee3b344be3d2368e087493 (patch) | |
tree | c6ba41cda0053cd7e23bb578d04fb889010b71ba | |
parent | 0b765249830576b995d9556c7e6a20ed37620337 (diff) | |
download | redis-5a9bc7cc1043911ecaee3b344be3d2368e087493.tar.gz |
replicationHandleMasterDisconnection() belongs to replication.c.
-rw-r--r-- | src/networking.c | 14 | ||||
-rw-r--r-- | src/replication.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/networking.c b/src/networking.c index 94b2eceec..53027d864 100644 --- a/src/networking.c +++ b/src/networking.c @@ -667,20 +667,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 = REDIS_REPL_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(redisClient *c) { listNode *ln; diff --git a/src/replication.c b/src/replication.c index 6d99d14f5..ab9778cfa 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1657,6 +1657,20 @@ void replicationUnsetMaster(void) { server.repl_state = REDIS_REPL_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 = REDIS_REPL_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(redisClient *c) { /* SLAVEOF is not allowed in cluster mode as replication is automatically * configured using the current address of the master node. */ |