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
2eb2f363
Commit
2eb2f363
authored
May 25, 2020
by
zhaozhao.zz
Committed by
antirez
May 27, 2020
Browse files
Revert "PSYNC2: second_replid_offset should be real meaningful offset"
This reverts commit
eec769be
.
parent
8dd01736
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
2eb2f363
...
@@ -2541,14 +2541,14 @@ void replicationUnsetMaster(void) {
...
@@ -2541,14 +2541,14 @@ void replicationUnsetMaster(void) {
sdsfree
(
server
.
masterhost
);
sdsfree
(
server
.
masterhost
);
server
.
masterhost
=
NULL
;
server
.
masterhost
=
NULL
;
if
(
server
.
master
)
freeClient
(
server
.
master
);
replicationDiscardCachedMaster
();
cancelReplicationHandshake
();
/* When a slave is turned into a master, the current replication ID
/* When a slave is turned into a master, the current replication ID
* (that was inherited from the master at synchronization time) is
* (that was inherited from the master at synchronization time) is
* used as secondary ID up to the current offset, and a new replication
* used as secondary ID up to the current offset, and a new replication
* ID is created to continue with a new replication history. */
* ID is created to continue with a new replication history. */
shiftReplicationId
();
shiftReplicationId
();
if
(
server
.
master
)
freeClient
(
server
.
master
);
replicationDiscardCachedMaster
();
cancelReplicationHandshake
();
/* Disconnecting all the slaves is required: we need to inform slaves
/* Disconnecting all the slaves is required: we need to inform slaves
* of the replication ID change (see shiftReplicationId() call). However
* of the replication ID change (see shiftReplicationId() call). However
* the slaves will be able to partially resync with us, so it will be
* the slaves will be able to partially resync with us, so it will be
...
...
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