From f0db157ec504d801f4f02547e2584b536764ad64 Mon Sep 17 00:00:00 2001 From: Roshan Khatri Date: Thu, 18 Jul 2024 19:18:56 +0000 Subject: [PATCH] Address feedback Signed-off-by: Roshan Khatri --- src/cluster_legacy.c | 2 +- src/pubsub.c | 12 ++++++------ src/server.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index d352ccc35d..53545dc8fc 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -3052,7 +3052,7 @@ int clusterProcessPacket(clusterLink *link) { if (!link->node || nodeInHandshake(link->node)) { freeClusterLink(link); serverLog( - LL_WARNING, + LL_NOTICE, "Closing link for node that sent a lightweight message of type %hu as its first message on the link", type); return 0; diff --git a/src/pubsub.c b/src/pubsub.c index eab2485cae..27496c7706 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -533,7 +533,7 @@ int pubsubPublishMessage(robj *channel, robj *message, int sharded) { } /* Publish messages to all the subscribers. */ -int pubsubPublishMessages(robj *channel, robj **messages, int count, int sharded) { +int pubsubPublishMultiMessages(robj *channel, robj **messages, int count, int sharded) { int total_receivers = 0; for (int i = 0; i < count; i++) { total_receivers += pubsubPublishMessage(channel, messages[i], sharded); @@ -612,14 +612,14 @@ void punsubscribeCommand(client *c) { /* This function wraps pubsubPublishMessage and also propagates the message to cluster. * Used by the commands PUBLISH/SPUBLISH and their respective module APIs.*/ -int pubsubPublishMessagesAndPropagateToCluster(robj *channel, robj **messages, int count, int sharded) { - int receivers = pubsubPublishMessages(channel, messages, count, sharded); +int pubsubPublishMultiMessagesAndPropagateToCluster(robj *channel, robj **messages, int count, int sharded) { + int receivers = pubsubPublishMultiMessages(channel, messages, count, sharded); if (server.cluster_enabled) clusterPropagatePublish(channel, messages, count, sharded); return receivers; } int pubsubPublishMessageAndPropagateToCluster(robj *channel, robj *message, int sharded) { - return pubsubPublishMessagesAndPropagateToCluster(channel, &message, 1, sharded); + return pubsubPublishMultiMessagesAndPropagateToCluster(channel, &message, 1, sharded); } /* PUBLISH */ @@ -629,7 +629,7 @@ void publishCommand(client *c) { return; } - int receivers = pubsubPublishMessagesAndPropagateToCluster(c->argv[1], &c->argv[2], 1, 0); + int receivers = pubsubPublishMultiMessagesAndPropagateToCluster(c->argv[1], &c->argv[2], 1, 0); if (!server.cluster_enabled) forceCommandPropagation(c, PROPAGATE_REPL); addReplyLongLong(c, receivers); } @@ -715,7 +715,7 @@ void channelList(client *c, sds pat, kvstore *pubsub_channels) { /* SPUBLISH */ void spublishCommand(client *c) { - int receivers = pubsubPublishMessagesAndPropagateToCluster(c->argv[1], &c->argv[2], 1, 1); + int receivers = pubsubPublishMultiMessagesAndPropagateToCluster(c->argv[1], &c->argv[2], 1, 1); if (!server.cluster_enabled) forceCommandPropagation(c, PROPAGATE_REPL); addReplyLongLong(c, receivers); } diff --git a/src/server.h b/src/server.h index cc072379cc..ae3e67ccc2 100644 --- a/src/server.h +++ b/src/server.h @@ -3289,9 +3289,9 @@ int pubsubUnsubscribeShardAllChannels(client *c, int notify); void pubsubShardUnsubscribeAllChannelsInSlot(unsigned int slot); int pubsubUnsubscribeAllPatterns(client *c, int notify); int pubsubPublishMessage(robj *channel, robj *message, int sharded); -int pubsubPublishMessages(robj *channel, robj **messages, int count, int sharded); +int pubsubPublishMultiMessages(robj *channel, robj **messages, int count, int sharded); int pubsubPublishMessageAndPropagateToCluster(robj *channel, robj *message, int sharded); -int pubsubPublishMessagesAndPropagateToCluster(robj *channel, robj **messages, int count, int sharded); +int pubsubPublishMultiMessagesAndPropagateToCluster(robj *channel, robj **messages, int count, int sharded); void addReplyPubsubMessage(client *c, robj *channel, robj *msg, robj *message_bulk); int serverPubsubSubscriptionCount(void); int serverPubsubShardSubscriptionCount(void);