Handle cache miss response in MultiStore
What does this MR do and why?
This MR addresses the inconsistent behaviour or MultiStore
when dealing with cache misses (empty response). redis-rb client returns several forms of "empty" responses
-
nil
for operations likeget
. This is a falsey -
true/false
for operations likesismember
andexists
. The value directly translates to truthy/falsey. -
0
for count-based lookups likesmembers
,hlen
or-2
forttl
. This is a truthy. -
[nil, nil...]
for operations likemget
. This is a truthy. -
[]
for operations likesmembers
. This is a truthy. -
{}
for operations likehgetall
. This is a truthy. -
[0, []
for operations likehscan
,sscan
. This is a truthy.
However, MultiStore
will perform a fallback_read only for nil
and false
responses since the other forms of responses are truthy.
See #386978 (closed) for more background.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sylvester Chin