From 88942544525c16569680c4aa824b37823b4448d4 Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Mon, 3 Apr 2023 11:53:07 +0100 Subject: [PATCH 1/3] fix #2426 - don't restict multi-slot operations on envoy proxy --- docs/ReleaseNotes.md | 2 +- src/StackExchange.Redis/ServerSelectionStrategy.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index e7e56b7f5..180b40e47 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -8,7 +8,7 @@ Current package versions: ## Unreleased -No pending unreleased changes. +- Fix [#2426](https://github.com/StackExchange/StackExchange.Redis/issues/2426): Don't restict multi-slot operations on envoy proxy; let the proxy decide ([#XXXX by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/XXXX)) ## 2.6.104 diff --git a/src/StackExchange.Redis/ServerSelectionStrategy.cs b/src/StackExchange.Redis/ServerSelectionStrategy.cs index a4dbb92a7..4a32da0d4 100644 --- a/src/StackExchange.Redis/ServerSelectionStrategy.cs +++ b/src/StackExchange.Redis/ServerSelectionStrategy.cs @@ -140,10 +140,15 @@ private static unsafe int GetClusterSlot(ReadOnlySpan blob) // strictly speaking some proxies use a different hashing algorithm, but the hash-tag behavior is // the same, so this does a pretty good job of spotting illegal commands before sending them case ServerType.Twemproxy: - case ServerType.Envoyproxy: slot = message.GetHashSlot(this); if (slot == MultipleSlots) throw ExceptionFactory.MultiSlot(multiplexer.RawConfig.IncludeDetailInExceptions, message); break; + /* just shown for completeness + case ServerType.Standalone: // don't use sharding + case ServerType.Envoyproxy: // defer to the proxy; see #2426 + default: // unknown scenario; defer to the server + break; + */ } return Select(slot, message.Command, message.Flags, allowDisconnected); } From 2f5dfc105aa8f6a2a260c28ce6f36f92075e5580 Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Mon, 3 Apr 2023 11:54:09 +0100 Subject: [PATCH 2/3] fill in PR details --- docs/ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 180b40e47..7632c16b8 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -8,7 +8,7 @@ Current package versions: ## Unreleased -- Fix [#2426](https://github.com/StackExchange/StackExchange.Redis/issues/2426): Don't restict multi-slot operations on envoy proxy; let the proxy decide ([#XXXX by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/XXXX)) +- Fix [#2426](https://github.com/StackExchange/StackExchange.Redis/issues/2426): Don't restrict multi-slot operations on envoy proxy; let the proxy decide ([#2428 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2428)) ## 2.6.104 From 4d20241c26cd5f8487482e1e7d840dcfc4e4891e Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Mon, 3 Apr 2023 13:07:22 +0100 Subject: [PATCH 3/3] caps --- docs/ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 7632c16b8..abe80ad12 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -8,7 +8,7 @@ Current package versions: ## Unreleased -- Fix [#2426](https://github.com/StackExchange/StackExchange.Redis/issues/2426): Don't restrict multi-slot operations on envoy proxy; let the proxy decide ([#2428 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2428)) +- Fix [#2426](https://github.com/StackExchange/StackExchange.Redis/issues/2426): Don't restrict multi-slot operations on Envoy proxy; let the proxy decide ([#2428 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2428)) ## 2.6.104