Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
cache: switch to Rueidis client for Redis #5593
cache: switch to Rueidis client for Redis #5593
Changes from 1 commit
7ee0670
1c3d163
b756c41
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This comment is now outdated.
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.
Why not
disableCaching := false
? I thought we usedvar
only to declare variables and use their type's zero-value.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.
Also, this is client-side caching, right? Could the variable be named
clientSideCacheEnabled
then? It is more concise with what it really is and avoids the "negative thinking" (which causes double negation whendisableCaching = false
.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.
Why here we use
Set
withExSeconds
being added later instead ofSetex
, like in theSetMulti
function? Would be cool to be consistent.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.
Also, wouldn't it be wise to use
DoCache
here to populate the client side cache too? I don't seeDoCache
orDoMultiCache
being used anymore and from what I understand from Rueidis' README those are functions that will also populate client side cache.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.
I noticed there is
MGetCache
for getting through client side cache, but I fail to see where we write to the client side cache.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.
Hi @douglascamata,
The population of client side cache is done by rueidis when you get successful responses from
DoCache
andDoMultiCache
with supported commands, such as GET and MGET.SET is not supported by
DoCache
by design, because the client must be tracked by redis server via cacheable requests to receive related invalidation notifications later.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.
@rueian gotcha, thanks for the clarification!
I thought it would be useful for us to populate the client side cache whenever we SET something, but it if the cost is another GET and by consequence of the design, might not be a good idea.