Skip to content

Handle cache miss response in MultiStore

Sylvester Chin requested to merge sc1-scaneach-multistore into master

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 like get. This is a falsey
  • true/false for operations like sismember and exists. The value directly translates to truthy/falsey.
  • 0 for count-based lookups like smembers, hlen or -2 for ttl. This is a truthy.
  • [nil, nil...] for operations like mget. This is a truthy.
  • [] for operations like smembers. This is a truthy.
  • {} for operations like hgetall. This is a truthy.
  • [0, [] for operations like hscan, 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.

Edited by Sylvester Chin

Merge request reports