Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update comments and log message in cluster_legacy.c #1561

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
enjoy-binbin marked this conversation as resolved.
Show resolved Hide resolved
"possibly caused by a closed connection.");
freeClusterLink(link);
return 0;
}
Expand All @@ -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));
}

Expand All @@ -3318,16 +3318,19 @@ 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);
enjoy-binbin marked this conversation as resolved.
Show resolved Hide resolved
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);
}
Expand Down
Loading