mirror of
https://github.com/redis/redis.git
synced 2026-10-28 08:25:04 +08:00
Set TCP_NODELAY and keepalive on the master connection after PSYNC (#16020)
After PSYNC, the cached master client is reused on the new connection, which never goes through createClient(). So TCP_NODELAY and keepalive are not set, and Nagle can delay REPLCONF ACK by ~40ms (WAIT latency).
This commit is contained in:
1 parent
f2a17a8dca
commit
c38dcdabf4
1 file changed
+3
@@ -4756,6 +4756,9 @@ void replicationResurrectCachedMaster(connection *conn) {
|
||||
server.master = server.cached_master;
|
||||
server.cached_master = NULL;
|
||||
server.master->conn = conn;
|
||||
connEnableTcpNoDelay(conn);
|
||||
if (server.tcpkeepalive)
|
||||
connKeepAlive(conn,server.tcpkeepalive);
|
||||
connSetPrivateData(server.master->conn, server.master);
|
||||
server.master->flags &= ~(CLIENT_CLOSE_AFTER_REPLY|CLIENT_CLOSE_ASAP);
|
||||
server.master->authenticated = 1;
|
||||
|
||||
Reference in new issue
Block a user