`RedisActionCache`: Store `ActionResult` value
Before raising this MR, consider whether the following are required, and complete if so:
- Unit tests
[ ] Metrics
- Documentation update(s)
If not required, please explain in brief why not.
These are changes in implementation details that are transparent to users of the
RedisActionCache class stores pairs that contain the serialized
Digest of the
ActionResult as their value. When querying the cache, it parses that
Digest and fetches the corresponding
ActionResult from the underlying storage.
This adds an option to make entries contain the
ActionResult itself. That way the
ActionResult can be read directly from the entry in Redis and a fetch from the storage avoided.
The method that carries out the actual read from Redis will always check the type of the entry in order to maintain compatibility with caches that were populated by another instance with a different configuration.
migrate-entries option can make
RedisActionCache convert the format of old entries to the new type as they are accessed.
Changes proposed in this merge request:
- Change constructor to receive an
update_action_result(): write the serialized message selected by the
get_action_result(): if present, parse the serialized
ActionResultfrom Redis instead of reading it from
storage. If the value read is not of
migrate_entriesis enabled, update the entry.
Addresses part of #350 (closed)