mirror of
https://github.com/fluencelabs/redis
synced 2025-05-01 13:32:13 +00:00
Sentinel: fix PUBLISH to masters and slaves.
This commit is contained in:
parent
b95c6ed7b7
commit
eba4775b5d
@ -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,
|
||||||
(ri->flags & SRI_CAN_FAILOVER) != 0,
|
(master->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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user