Skip to content

Commit

Permalink
Fix #2426 - don't restrict multi-slot operations on envoy proxy (#2428)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgravell authored Apr 3, 2023
1 parent 8872553 commit 571d832
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Current package versions:

## Unreleased

No pending unreleased changes.
- 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

Expand Down
7 changes: 6 additions & 1 deletion src/StackExchange.Redis/ServerSelectionStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,15 @@ private static unsafe int GetClusterSlot(ReadOnlySpan<byte> 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);
}
Expand Down

0 comments on commit 571d832

Please sign in to comment.