RDB Channel connections mistakenly discovered by Sentinel (#14728) (#14729)
Some checks are pending
CI / test-ubuntu-latest (push) Waiting to run
CI / test-sanitizer-address (push) Waiting to run
CI / build-debian-old (push) Waiting to run
CI / build-macos-latest (push) Waiting to run
CI / build-32bit (push) Waiting to run
CI / build-libc-malloc (push) Waiting to run
CI / build-centos-jemalloc (push) Waiting to run
CI / build-old-chain-jemalloc (push) Waiting to run
Codecov / code-coverage (push) Waiting to run
External Server Tests / test-external-standalone (push) Waiting to run
External Server Tests / test-external-cluster (push) Waiting to run
External Server Tests / test-external-nodebug (push) Waiting to run
Spellcheck / Spellcheck (push) Waiting to run

Fix RDB Channel connections mistakenly discovered by Sentinel

During fullsync, if the main replication connection is interrupted, but
the rdbchannel connection is still active, it will be visible in the
"info replication" output. Currently, the rdbchannel connection does not
send `REPLCONF ip-address`, and in a meshed scenario, when the source IP
addresses of both connections differ, Sentinel will treat them as
separate replicas. This commit adds `REPLCONF ip-address` to rdbchannel
replica handshake if `server.slave_announce_ip` is enabled.

fixes: https://github.com/redis/redis/issues/14728

Co-authored-by: Ozan Tezcan <ozantezcan@gmail.com>
This commit is contained in:
I 2026-02-02 12:02:44 +01:00 committed by GitHub
parent bafaec5b6a
commit 02700f11cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3724,7 +3724,11 @@ static int rdbChannelSendHandshake(connection *conn, sds *err) {
*err = sendCommand(conn, "REPLCONF", "capa", "eof", "rdb-only", "1",
"rdb-channel", "1", "main-ch-client-id", cid,
"listening-port", buf, NULL);
"listening-port", buf,
server.slave_announce_ip ? "ip-address" : NULL,
server.slave_announce_ip ? server.slave_announce_ip : NULL,
NULL);
if (*err) {
serverLog(LL_WARNING, "Error sending REPLCONF command to master in rdb channel handshake: %s", *err);
return C_ERR;