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
2e167f7d
Commit
2e167f7d
authored
Jun 30, 2018
by
WuYunlong
Browse files
fix server.repl_down_since resetting, so that slaves could failover
automatically as expected.
parent
aeb7bc3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
2e167f7d
...
@@ -1087,6 +1087,7 @@ void replicationCreateMasterClient(int fd, int dbid) {
...
@@ -1087,6 +1087,7 @@ void replicationCreateMasterClient(int fd, int dbid) {
if
(
server
.
master
->
reploff
==
-
1
)
if
(
server
.
master
->
reploff
==
-
1
)
server
.
master
->
flags
|=
CLIENT_PRE_PSYNC
;
server
.
master
->
flags
|=
CLIENT_PRE_PSYNC
;
if
(
dbid
!=
-
1
)
selectDb
(
server
.
master
,
dbid
);
if
(
dbid
!=
-
1
)
selectDb
(
server
.
master
,
dbid
);
server
.
repl_down_since
=
0
;
}
}
void
restartAOF
()
{
void
restartAOF
()
{
...
@@ -1950,7 +1951,6 @@ void replicationSetMaster(char *ip, int port) {
...
@@ -1950,7 +1951,6 @@ void replicationSetMaster(char *ip, int port) {
* our own parameters, to later PSYNC with the new master. */
* our own parameters, to later PSYNC with the new master. */
if
(
was_master
)
replicationCacheMasterUsingMyself
();
if
(
was_master
)
replicationCacheMasterUsingMyself
();
server
.
repl_state
=
REPL_STATE_CONNECT
;
server
.
repl_state
=
REPL_STATE_CONNECT
;
server
.
repl_down_since
=
0
;
}
}
/* Cancel replication, setting the instance as a master itself. */
/* Cancel replication, setting the instance as a master itself. */
...
...
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