From d5cb96247a289900f3f2a6f6bf09c37cb53555da Mon Sep 17 00:00:00 2001 From: Pierre Turin Date: Tue, 14 Jan 2025 22:38:00 +0000 Subject: [PATCH 1/2] Update comments and log message in cluster_legacy.c Signed-off-by: Pierre Turin --- src/cluster_legacy.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index 5c4bb65aae..15802528a2 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -3278,8 +3278,8 @@ int clusterProcessPacket(clusterLink *link) { /* Unable to retrieve the node's IP address from the connection. Without a * valid IP, the node becomes unusable in the cluster. This failure might be * due to the connection being closed. */ - serverLog(LL_NOTICE, "Closing link even though we received a MEET packet on it, " - "because the connection has an error"); + serverLog(LL_NOTICE, "Closing cluster link due to failure to retrieve IP from the connection, " + "possibly caused by a closed connection."); freeClusterLink(link); return 0; } @@ -3302,14 +3302,14 @@ int clusterProcessPacket(clusterLink *link) { clusterAddNode(node); clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG); } else { - /* A second MEET packet was received on an existing link during the handshake process. - * This happens when the other node detects no inbound link, and re-sends a MEET packet - * before this node can respond with a PING. This MEET is a no-op. + /* A second MEET packet was received on an existing link during the handshake + * process. This happens when the other node detects no inbound link, and + * re-sends a MEET packet before this node can respond with a PING. + * This MEET is a no-op. * - * Note: Nodes in HANDSHAKE state are not fully "known" (random names), so the sender - * remains unidentified at this point. The MEET packet might be re-sent if the inbound - * connection is still unestablished by the next cron cycle. - */ + * Note: Nodes in HANDSHAKE state are not fully "known" (random names), so the + * sender remains unidentified at this point. The MEET packet might be re-sent + * if the inbound connection is still unestablished by the next cron cycle. */ debugServerAssert(link->inbound && nodeInHandshake(link->node)); } @@ -3318,12 +3318,14 @@ int clusterProcessPacket(clusterLink *link) { * of the message type. */ clusterProcessGossipSection(hdr, link); } else if (sender->link && nodeExceedsHandshakeTimeout(sender, now)) { - /* The MEET packet is from a known node, after the handshake timeout, so the sender thinks that I do not - * know it. - * Free my outbound link to that node, triggering a reconnect and a PING over the new link. - * Once that node receives our PING, it should recognize the new connection as an inbound link from me. - * We should only free the outbound link if the node is known for more time than the handshake timeout, - * since during this time, the other side might still be trying to complete the handshake. */ + /* The MEET packet is from a known node, after the handshake timeout, so the sender + * thinks that I do not know it. + * Free my outbound link to that node, triggering a reconnect and a PING over the + * new link. + * Once that node receives our PING, it should recognize the new connection as an + * inbound link from me. We should only free the outbound link if the node is known + * for more time than the handshake timeout, since during this time, the other side + * might still be trying to complete the handshake. */ /* We should always receive a MEET packet on an inbound link. */ serverAssert(link != sender->link); From 28653a3153dc49453a77cfed20758f339021ae7e Mon Sep 17 00:00:00 2001 From: Pierre Turin Date: Thu, 16 Jan 2025 22:18:57 +0000 Subject: [PATCH 2/2] Split log line which was more than 120 chars Signed-off-by: Pierre Turin --- src/cluster_legacy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index 15802528a2..011d5d705b 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -3329,7 +3329,8 @@ int clusterProcessPacket(clusterLink *link) { /* We should always receive a MEET packet on an inbound link. */ serverAssert(link != sender->link); - serverLog(LL_NOTICE, "Freeing outbound link to node %.40s (%s) after receiving a MEET packet from this known node", + serverLog(LL_NOTICE, "Freeing outbound link to node %.40s (%s) after receiving a MEET packet " + "from this known node", sender->name, sender->human_nodename); freeClusterLink(sender->link); }