diff options
author | Harkrishn Patro <harkrisp@amazon.com> | 2022-05-30 22:03:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 08:03:59 +0300 |
commit | 4065b4f27efc539b86beb63829bc148a02adecb1 (patch) | |
tree | 13f2c1d3e1ca0e7710ede98640814e81d837b705 /tests/cluster | |
parent | d7ae858745f722b845d3540a437f89a7fb8d0bb2 (diff) | |
download | redis-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 'tests/cluster')
-rw-r--r-- | tests/cluster/tests/25-pubsubshard-slot-migration.tcl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/cluster/tests/25-pubsubshard-slot-migration.tcl b/tests/cluster/tests/25-pubsubshard-slot-migration.tcl index 11b77d36a..0f59ffef2 100644 --- a/tests/cluster/tests/25-pubsubshard-slot-migration.tcl +++ b/tests/cluster/tests/25-pubsubshard-slot-migration.tcl @@ -29,7 +29,7 @@ test "Migrate a slot, verify client receives sunsubscribe on primary serving the # Verify subscribe is still valid, able to receive messages. $nodefrom(link) spublish $channelname hello - assert_equal {message mychannel hello} [$subscribeclient read] + assert_equal {smessage mychannel hello} [$subscribeclient read] assert_equal {OK} [$nodefrom(link) cluster setslot $slot node $nodeto(id)] @@ -66,7 +66,7 @@ test "Client subscribes to multiple channels, migrate a slot, verify client rece # Verify subscribe is still valid, able to receive messages. $nodefrom(link) spublish $channelname hello - assert_equal {message ch3 hello} [$subscribeclient read] + assert_equal {smessage ch3 hello} [$subscribeclient read] assert_equal {OK} [$nodefrom(link) cluster setslot $slot node $nodeto(id)] @@ -82,7 +82,7 @@ test "Client subscribes to multiple channels, migrate a slot, verify client rece # Verify the client is still connected and receives message from the other channel. set msg [$subscribeclient read] - assert {"message" eq [lindex $msg 0]} + assert {"smessage" eq [lindex $msg 0]} assert {$anotherchannelname eq [lindex $msg 1]} assert {"hello" eq [lindex $msg 2]} @@ -114,7 +114,7 @@ test "Migrate a slot, verify client receives sunsubscribe on replica serving the # Verify subscribe is still valid, able to receive messages. $nodefrom(link) spublish $channelname hello - assert_equal {message mychannel1 hello} [$subscribeclient read] + assert_equal {smessage mychannel1 hello} [$subscribeclient read] assert_equal {OK} [$nodefrom(link) cluster setslot $slot node $nodeto(id)] assert_equal {OK} [$nodeto(link) cluster setslot $slot node $nodeto(id)] |