Skip to content

Conversation

@NickCraver
Copy link
Collaborator

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)

…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);
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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);
}

Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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.

@NickCraver NickCraver marked this pull request as ready for review January 20, 2022 16:20
@NickCraver NickCraver requested a review from mgravell January 20, 2022 16:20
@NickCraver
Copy link
Collaborator Author

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 Task.Run race on the subscription loop is bad (to be fixed after this prep).

@NickCraver
Copy link
Collaborator Author

@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);
Copy link
Collaborator

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"

Copy link
Collaborator

@mgravell mgravell left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default keep alive behavior only works for the Interactive ConnectionType

3 participants