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
eba4775b
Commit
eba4775b
authored
Nov 12, 2013
by
antirez
Browse files
Sentinel: fix PUBLISH to masters and slaves.
parent
b95c6ed7
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
eba4775b
...
@@ -1829,13 +1829,13 @@ void sentinelPingInstance(sentinelRedisInstance *ri) {
...
@@ -1829,13 +1829,13 @@ void sentinelPingInstance(sentinelRedisInstance *ri) {
if
(
anetSockName
(
ri
->
cc
->
c
.
fd
,
ip
,
sizeof
(
ip
),
NULL
)
!=
-
1
)
{
if
(
anetSockName
(
ri
->
cc
->
c
.
fd
,
ip
,
sizeof
(
ip
),
NULL
)
!=
-
1
)
{
char
payload
[
REDIS_IP_STR_LEN
+
1024
];
char
payload
[
REDIS_IP_STR_LEN
+
1024
];
sentinelRedisInstance
*
master
=
(
ri
->
flags
&
SRI_MASTER
)
?
sentinelRedisInstance
*
master
=
(
ri
->
flags
&
SRI_MASTER
)
?
NULL
:
ri
->
master
;
ri
:
ri
->
master
;
snprintf
(
payload
,
sizeof
(
payload
),
snprintf
(
payload
,
sizeof
(
payload
),
"%s,%d,%s,%d,%llu,"
/* Info about this sentinel. */
"%s,%d,%s,%d,%llu,"
/* Info about this sentinel. */
"%s,%s,%d,%lld"
,
/* Info about current master. */
"%s,%s,%d,%lld"
,
/* Info about current master. */
ip
,
server
.
port
,
server
.
runid
,
ip
,
server
.
port
,
server
.
runid
,
(
r
i
->
flags
&
SRI_CAN_FAILOVER
)
!=
0
,
(
maste
r
->
flags
&
SRI_CAN_FAILOVER
)
!=
0
,
(
unsigned
long
long
)
sentinel
.
current_epoch
,
(
unsigned
long
long
)
sentinel
.
current_epoch
,
/* --- */
/* --- */
master
->
name
,
master
->
addr
->
ip
,
master
->
addr
->
port
,
master
->
name
,
master
->
addr
->
ip
,
master
->
addr
->
port
,
...
...
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