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
49f2f691
Commit
49f2f691
authored
Aug 21, 2015
by
antirez
Browse files
Log client details on SLAVEOF command having an effect.
parent
c2ff9de3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
49f2f691
...
...
@@ -1716,7 +1716,10 @@ void slaveofCommand(redisClient *c) {
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"one"
))
{
if
(
server
.
masterhost
)
{
replicationUnsetMaster
();
redisLog
(
REDIS_NOTICE
,
"MASTER MODE enabled (user request)"
);
sds
client
=
catClientInfoString
(
sdsempty
(),
c
);
redisLog
(
REDIS_NOTICE
,
"MASTER MODE enabled (user request from '%s')"
,
client
);
sdsfree
(
client
);
}
}
else
{
long
port
;
...
...
@@ -1734,8 +1737,10 @@ void slaveofCommand(redisClient *c) {
/* There was no previous master or the user specified a different one,
* we can continue. */
replicationSetMaster
(
c
->
argv
[
1
]
->
ptr
,
port
);
redisLog
(
REDIS_NOTICE
,
"SLAVE OF %s:%d enabled (user request)"
,
server
.
masterhost
,
server
.
masterport
);
sds
client
=
catClientInfoString
(
sdsempty
(),
c
);
redisLog
(
REDIS_NOTICE
,
"SLAVE OF %s:%d enabled (user request from '%s')"
,
server
.
masterhost
,
server
.
masterport
,
client
);
sdsfree
(
client
);
}
addReply
(
c
,
shared
.
ok
);
}
...
...
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