-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support different read mode in RedisHybridCacheClient #83
Support different read mode in RedisHybridCacheClient #83
Conversation
Zinnia Wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
1 similar comment
Zinnia Wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Have signed the Contributor License Agreement. |
Thanks for the PR! Also, those charts were awesome, would you mind sharing more on this (do you have a script that generates images automatically? I've been needing to look to see if there is a good way to do this with otel.):
|
@niemyjski Also, wondering if you can release a new version? Because I need this change to improve the performance of our system. |
Please use a nightly feed (would be good to see if you see any other issues), I need to check to see what else we need to do before next release. |
@niemyjski I tried to run this cmd: dotnet add package Foundatio.Redis --version 10.7.1-alpha.0.1 Can you see if it is working on your side? |
Do you have a package source for the nighties defined? https://github.com/exceptionless/Exceptionless/blob/883d75b47a1bab7009e960a615429223162f5be4/NuGet.Config#L4 |
Right. It's working! Thanks for your help. |
At the moment, Even if we setup the Read mode in RedisHybridCacheClientOptions while creating the RedisHybridCacheClient instance, it doesn't work when we access the Redis.
The reason for that is because when we call the base object like this, we didn't pass the options.ReadMode in.
Foundatio.Redis/src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs
Line 9 in ceb704b
So the base readmode is always CommandFlags.None.
Foundatio.Redis/src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs
Line 17 in ceb704b
Here is the example before/after the code update when we set the read mode as PreferReplica, the GetTypeCmds indicates the total number of read-only type commands. This is derived from the Redis commandstats statistic by summing all of the read-only type commands (get, hget, scard, lrange, and so on.):
The 001 nodes of both shards are the masters:
Before the code update, we can see all the read call still goes to the master node.
After the code update, the application starts fetching data from read replica.