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
18698b52
Commit
18698b52
authored
Oct 27, 2014
by
antirez
Browse files
Log slave ip:port in more log messages.
parent
f6879766
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
18698b52
...
@@ -369,7 +369,8 @@ int masterTryPartialResynchronization(redisClient *c) {
...
@@ -369,7 +369,8 @@ int masterTryPartialResynchronization(redisClient *c) {
"Runid mismatch (Client asked for runid '%s', my runid is '%s')",
"Runid mismatch (Client asked for runid '%s', my runid is '%s')",
master_runid, server.runid);
master_runid, server.runid);
} else {
} else {
redisLog
(
REDIS_NOTICE
,
"Full resync requested by slave."
);
redisLog(REDIS_NOTICE,"Full resync requested by slave %s",
replicationGetSlaveName(c));
}
}
goto need_full_resync;
goto need_full_resync;
}
}
...
@@ -382,10 +383,10 @@ int masterTryPartialResynchronization(redisClient *c) {
...
@@ -382,10 +383,10 @@ int masterTryPartialResynchronization(redisClient *c) {
psync_offset > (server.repl_backlog_off + server.repl_backlog_histlen))
psync_offset > (server.repl_backlog_off + server.repl_backlog_histlen))
{
{
redisLog(REDIS_NOTICE,
redisLog(REDIS_NOTICE,
"Unable to partial resync with
the
slave for lack of backlog (Slave request was: %lld)."
,
psync_offset
);
"Unable to partial resync with slave
%s
for lack of backlog (Slave request was: %lld).",
replicationGetSlaveName(c),
psync_offset);
if (psync_offset > server.master_repl_offset) {
if (psync_offset > server.master_repl_offset) {
redisLog(REDIS_WARNING,
redisLog(REDIS_WARNING,
"Warning: slave tried to PSYNC with an offset that is greater than the master replication offset."
);
"Warning: slave
%s
tried to PSYNC with an offset that is greater than the master replication offset."
, replicationGetSlaveName(c)
);
}
}
goto need_full_resync;
goto need_full_resync;
}
}
...
@@ -408,7 +409,9 @@ int masterTryPartialResynchronization(redisClient *c) {
...
@@ -408,7 +409,9 @@ int masterTryPartialResynchronization(redisClient *c) {
}
}
psync_len = addReplyReplicationBacklog(c,psync_offset);
psync_len = addReplyReplicationBacklog(c,psync_offset);
redisLog(REDIS_NOTICE,
redisLog(REDIS_NOTICE,
"Partial resynchronization request accepted. Sending %lld bytes of backlog starting from offset %lld."
,
psync_len
,
psync_offset
);
"Partial resynchronization request from %s accepted. Sending %lld bytes of backlog starting from offset %lld.",
replicationGetSlaveName(c),
psync_len, psync_offset);
/* Note that we don't need to set the selected DB at server.slaveseldb
/* Note that we don't need to set the selected DB at server.slaveseldb
* to -1 to force the master to emit SELECT, since the slave already
* to -1 to force the master to emit SELECT, since the slave already
* has this state from the previous connection with the master. */
* has this state from the previous connection with the master. */
...
@@ -475,7 +478,8 @@ void syncCommand(redisClient *c) {
...
@@ -475,7 +478,8 @@ void syncCommand(redisClient *c) {
return;
return;
}
}
redisLog
(
REDIS_NOTICE
,
"Slave asks for synchronization"
);
redisLog(REDIS_NOTICE,"Slave %s asks for synchronization",
replicationGetSlaveName(c));
/* Try a partial resynchronization if this is a PSYNC command.
/* Try a partial resynchronization if this is a PSYNC command.
* If it fails, we continue with usual full resynchronization, however
* If it fails, we continue with usual full resynchronization, however
...
@@ -750,7 +754,8 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type) {
...
@@ -750,7 +754,8 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type) {
if (type == REDIS_RDB_CHILD_TYPE_SOCKET) {
if (type == REDIS_RDB_CHILD_TYPE_SOCKET) {
putSlaveOnline(slave);
putSlaveOnline(slave);
redisLog(REDIS_NOTICE,
redisLog(REDIS_NOTICE,
"Synchronization with slave succeeded (socket)"
);
"Synchronization with slave %s succeeded (socket)",
replicationGetSlaveName(slave));
} else {
} else {
if (bgsaveerr != REDIS_OK) {
if (bgsaveerr != REDIS_OK) {
freeClient(slave);
freeClient(slave);
...
...
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