Skip to content
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

[release/9.0] Redis distributed cache: add HybridCache usage signal #59886

Open
wants to merge 1 commit into
base: release/9.0
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 15, 2025

Backport of #59543 to release/9.0

/cc @mgravell

Redis distributed cache: add HybridCache usage signal

Add connection usage marker for HybridCache to improve connection metadata / visibility.

Description

{Detail}

We already use "DC" and "OC" markers on RESP connections to provide a non-intrusive signal that Distributed Cache and Output Cache are being used; since HybridCache is a feature on top of IDistributedCache, here we add an additional "HC" token to indicate that a RESP connection is being used for HybridCache.

We do this by using IServiceProvider (changing the internal RedisCacheImpl(...) constructors) to detect HybridCache as a service. We don't need it to be the official HybridCache specifically (as in .AddHybridCache()) - just that a HybridCache exists. There are no public API or dependency changes required.

Customer Impact

Improves connection metadata / visibility, i.e. we know what different Redis connections are being used for.

No API changes. Improves internal metrics.

Regression?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

[Justify the selection above]

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.1

  • Make necessary changes in eng/PatchConfig.props

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jan 15, 2025
Copy link
Contributor

Hi @github-actions[bot]. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document.
Otherwise, please add tell-mode label.

@dotnet-policy-service dotnet-policy-service bot added this to the 9.0.x milestone Jan 15, 2025
@jodydonetti
Copy link
Contributor

Hi, how does this signal tweak the connection?
Is there something else 3rd party HybridCache implementers should be aware of?

For example with FusionCache it's totally possible to use RedisCache in our apps without being forced to use that as the L2 of FusionCache, even when using it via the HybridCache adapter: in this case the checks I see here would not be technically "correct".

Can a false detection create problems?

Thanks.

Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jan 24, 2025
@mgravell
Copy link
Member

Tactics requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants