-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Pub/Sub: default to 3.0, fix PING, fix server selection in cluster, and cleanup #1958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd cleanup In prep for changes to how we handle subscriptions internally, this does several things: - Upgrades default Redis server assumption to 3.x - Routes PING on Subscription keepalives over the subscription bridge appropriately - Fixes cluster sharding from default(RedisKey) to shared logic for RedisChannel as well (both in byte[] form) - General code cleanup in the area (getting a lot of DEBUG/VERBOSE noise into isolated files)
| public Version DefaultVersion | ||
| { | ||
| get => defaultVersion ?? (IsAzureEndpoint() ? RedisFeatures.v4_0_0 : RedisFeatures.v2_8_0); | ||
| get => defaultVersion ?? (IsAzureEndpoint() ? RedisFeatures.v4_0_0 : RedisFeatures.v3_0_0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that we go with PING off the bat
| @@ -0,0 +1,50 @@ | |||
| using System; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are method moves - no functional changes
| @@ -0,0 +1,59 @@ | |||
| using System; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are method moves - no functional changes
| { | ||
| if (condition) OnTraceWithoutContext(message, category); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to another partial
| if (server != null && message != null) | ||
| { | ||
| var bs = server.GetBridgeStatus(message.Command); | ||
| var bs = server.GetBridgeStatus(message.IsForSubscriptionBridge ? ConnectionType.Subscription: ConnectionType.Interactive); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we were also getting the wrong error stats, for the command we sent to the wrong place - fixing that.
|
Note: pub/sub failing tests are because subscriptions don't do awesome things, and we're not masking that - the tests are correct, overall implementation and our |
|
@mgravell ^ this is the cheese move (tests appropriately failing) |
| /// </summary> | ||
| /// <param name="channel">The <see cref="RedisChannel"/> to determine a slot ID for.</param> | ||
| public int HashSlot(in RedisChannel channel) | ||
| => ServerType == ServerType.Standalone || channel.IsNull ? NoSlot : GetClusterSlot((byte[])channel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO Marc: consider this in my "don't use byte[] for GetClusterSlot rework"
mgravell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good; some side thoughts
In prep for changes to how we handle subscriptions internally, this does several things: