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
1025dd77
Commit
1025dd77
authored
Mar 05, 2013
by
antirez
Browse files
Cluster: connect to our master ASAP after startup if we are a slave node.
parent
bac57ad1
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
1025dd77
...
...
@@ -1362,6 +1362,18 @@ void clusterCron(void) {
}
}
dictReleaseIterator
(
di
);
/* If we are a slave node but the replication is still turned off,
* enable it if we know the address of our master and it appears to
* be up. */
if
(
server
.
cluster
->
myself
->
flags
&
REDIS_NODE_SLAVE
&&
server
.
masterhost
==
NULL
&&
server
.
cluster
->
myself
->
slaveof
&&
!
(
server
.
cluster
->
myself
->
slaveof
->
flags
&
REDIS_NODE_NOADDR
))
{
replicationSetMaster
(
server
.
cluster
->
myself
->
slaveof
->
ip
,
server
.
cluster
->
myself
->
slaveof
->
port
);
}
}
/* -----------------------------------------------------------------------------
...
...
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