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
c80d81c8
Commit
c80d81c8
authored
Mar 23, 2020
by
antirez
Browse files
Improve comments of replicationCacheMasterUsingMyself().
parent
61de1c11
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
c80d81c8
...
@@ -2725,9 +2725,14 @@ void replicationCacheMaster(client *c) {
...
@@ -2725,9 +2725,14 @@ void replicationCacheMaster(client *c) {
* current offset if no data was lost during the failover. So we use our
* current offset if no data was lost during the failover. So we use our
* current replication ID and offset in order to synthesize a cached master. */
* current replication ID and offset in order to synthesize a cached master. */
void
replicationCacheMasterUsingMyself
(
void
)
{
void
replicationCacheMasterUsingMyself
(
void
)
{
/* This will be used to populate the field server.master->reploff
* by replicationCreateMasterClient(). We'll later set the created
* master as server.cached_master, so the replica will use such
* offset for PSYNC. */
server
.
master_initial_offset
=
server
.
master_repl_offset
;
/* The master client we create can be set to any DBID, because
/* The master client we create can be set to any DBID, because
* the new master will start its replication stream with SELECT. */
* the new master will start its replication stream with SELECT. */
server
.
master_initial_offset
=
server
.
master_repl_offset
;
replicationCreateMasterClient
(
NULL
,
-
1
);
replicationCreateMasterClient
(
NULL
,
-
1
);
/* Use our own ID / offset. */
/* Use our own ID / offset. */
...
...
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