i am using redis-6.2.1 now
here is the log msg when a node recive a ping/meet/pong msg
serverLog(LL_DEBUG,"%s packet received: %p",
type == CLUSTERMSG_TYPE_PING ? "ping" : "pong",
(void*)link->node);
lets say if the type is equal to CLUSTERMSG_TYPE_MEET, then we have such log msg pong packet received: (nil)
we actually get a meet(meet == ping) packet for sure, but we have such "pong received" msg
918:M 23 Apr 2021 14:47:40.258 . --- Processing packet of type 2, 2256 bytes
918:M 23 Apr 2021 14:47:40.258 . Ping packet received: (nil) # log from cluster.c#L1827 <=========
918:M 23 Apr 2021 14:47:40.258 # IP address for this node updated to 127.0.0.1
918:M 23 Apr 2021 14:47:40.259 . pong packet received: (nil) # log from cluster.c#L1884 <=========
918:M 23 Apr 2021 14:47:40.274 - Accepting cluster node connection from 127.0.0.1:55356
918:M 23 Apr 2021 14:47:40.274 . --- Processing packet of type 2, 2256 bytes
918:M 23 Apr 2021 14:47:40.274 . Ping packet received: (nil)
918:M 23 Apr 2021 14:47:40.275 . pong packet received: (nil)
918:M 23 Apr 2021 14:47:40.304 - Accepting cluster node connection from 127.0.0.1:55357
918:M 23 Apr 2021 14:47:40.304 . --- Processing packet of type 2, 2256 bytes
that makes me confused a little bit when i look into debug log file, and the master branch still hold these codes
to make log more clearer, maybe we could change that type condition to this:
serverLog(LL_DEBUG,"%s packet received: %p",
type == CLUSTERMSG_TYPE_PONG ? "pong" : "ping",
(void*)link->node);
Comment From: huangzhw
When I read the cluser code, I found this too. I will make a pull request.
Comment From: allenling
@huangzhw thanks!