summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorHarkrishn Patro <harkrisp@amazon.com>2022-05-30 22:03:59 -0700
committerGitHub <noreply@github.com>2022-05-31 08:03:59 +0300
commit4065b4f27efc539b86beb63829bc148a02adecb1 (patch)
tree13f2c1d3e1ca0e7710ede98640814e81d837b705 /src/server.h
parentd7ae858745f722b845d3540a437f89a7fb8d0bb2 (diff)
downloadredis-4065b4f27efc539b86beb63829bc148a02adecb1.tar.gz
Sharded pubsub publish messagebulk as smessage (#10792)
To easily distinguish between sharded channel message and a global channel message, introducing `smessage` (instead of `message`) as message bulk for sharded channel publish message. This is gonna be a breaking change in 7.0.1! Background: Sharded pubsub introduced in redis 7.0, but after the release we quickly realized that the fact that it's problematic that the client can't distinguish between normal (global) pubsub messages and sharded ones. This is important because the same connection can subscribe to both, but messages sent to one pubsub system are not propagated to the other (they're completely separate), so if one connection is used to subscribe to both, we need to assist the client library to know which message it got so it can forward it to the correct callback.
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server.h b/src/server.h
index 75f7aba60..b34a84cd7 100644
--- a/src/server.h
+++ b/src/server.h
@@ -1228,7 +1228,7 @@ struct sharedObjectsStruct {
*time, *pxat, *absttl, *retrycount, *force, *justid, *entriesread,
*lastid, *ping, *setid, *keepttl, *load, *createconsumer,
*getack, *special_asterick, *special_equals, *default_username, *redacted,
- *ssubscribebulk,*sunsubscribebulk,
+ *ssubscribebulk,*sunsubscribebulk, *smessagebulk,
*select[PROTO_SHARED_SELECT_CMDS],
*integers[OBJ_SHARED_INTEGERS],
*mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
@@ -2991,7 +2991,7 @@ void pubsubUnsubscribeShardChannels(robj **channels, unsigned int count);
int pubsubUnsubscribeAllPatterns(client *c, int notify);
int pubsubPublishMessage(robj *channel, robj *message, int sharded);
int pubsubPublishMessageAndPropagateToCluster(robj *channel, robj *message, int sharded);
-void addReplyPubsubMessage(client *c, robj *channel, robj *msg);
+void addReplyPubsubMessage(client *c, robj *channel, robj *msg, robj *message_bulk);
int serverPubsubSubscriptionCount();
int serverPubsubShardSubscriptionCount();