Skip to content

Executing Multi Slot commands through Envoy Proxy #2426

@dceravigupta

Description

@dceravigupta

I have a cache which consists of multiple standalone Redis instances all behind an Envoy Proxy. As per the Envoy documentation, it is capable of fanning out a multi slot command like MGET to the right Redis instances based on its hash slot. It works as expected when I run such commands through redis-cli.
image

But in my .NET application, when I issue such command through StackExchange.Redis, it throws an exception saying Multi-key operations must involve a single slot; Wondering is there any way to execute such operations in my step?

image

image
StackExchange.Redis.RedisCommandException HResult=0x80131500 Message=Multi-key operations must involve a single slot; keys can use 'hash tags' to help this, i.e. '{/users/12345}/account' and '{/users/12345}/contacts' will always be in the same slot Source=StackExchange.Redis StackTrace: at StackExchange.Redis.ServerSelectionStrategy.Select(Message message, Boolean allowDisconnected) in /_/src/StackExchange.Redis/ServerSelectionStrategy.cs:line 148 at StackExchange.Redis.ConnectionMultiplexer.SelectServer(Message message) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1828 at StackExchange.Redis.ConnectionMultiplexer.PrepareToPushMessageToBridge[T](Message message, ResultProcessor1 processor, IResultBox1 resultBox, ServerEndPoint& server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1843 at StackExchange.Redis.ConnectionMultiplexer.TryPushMessageToBridgeSync[T](Message message, ResultProcessor1 processor, IResultBox1 resultBox, ServerEndPoint& server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1905 at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 processor, ServerEndPoint server, T defaultValue) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1966
at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor1 processor, ServerEndPoint server, T defaultValue) in /_/src/StackExchange.Redis/RedisBase.cs:line 62 at StackExchange.Redis.RedisDatabase.StringGet(RedisKey[] keys, CommandFlags flags) in /_/src/StackExchange.Redis/RedisDatabase.cs:line 3028 at Program.<Main>$(String[] args) in C:\Users\ravgup\source\repos\ConsoleApp14\ConsoleApp14\Program.cs:line 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions