Skip to content

Commit 571d832

Browse files
authored
Fix #2426 - don't restrict multi-slot operations on envoy proxy (#2428)
1 parent 8872553 commit 571d832

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/ReleaseNotes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Current package versions:
88

99
## Unreleased
1010

11-
No pending unreleased changes.
11+
- 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))
1212

1313
## 2.6.104
1414

src/StackExchange.Redis/ServerSelectionStrategy.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,15 @@ private static unsafe int GetClusterSlot(ReadOnlySpan<byte> blob)
140140
// strictly speaking some proxies use a different hashing algorithm, but the hash-tag behavior is
141141
// the same, so this does a pretty good job of spotting illegal commands before sending them
142142
case ServerType.Twemproxy:
143-
case ServerType.Envoyproxy:
144143
slot = message.GetHashSlot(this);
145144
if (slot == MultipleSlots) throw ExceptionFactory.MultiSlot(multiplexer.RawConfig.IncludeDetailInExceptions, message);
146145
break;
146+
/* just shown for completeness
147+
case ServerType.Standalone: // don't use sharding
148+
case ServerType.Envoyproxy: // defer to the proxy; see #2426
149+
default: // unknown scenario; defer to the server
150+
break;
151+
*/
147152
}
148153
return Select(slot, message.Command, message.Flags, allowDisconnected);
149154
}

0 commit comments

Comments
 (0)