v0.21.0 · foyer-rs foyer · Discussion #1210

5 min read Original article ↗
crate version
foyer 0.21.0
foyer-common 0.21.0
foyer-memory 0.21.0
foyer-storage 0.21.0
foyer-bench 0.21.0

Changes

Important

Breaking Changes:

  • Hybrid cache and memory cache fetch() API is renamed to get_or_fetch(), and there are subtle changes in the arguments.
  • Hybrid cache get() API functions the same as the previous obtain(), and the obtain() API is removed because the naming is obscure.
  • The Error type returned by all interfaces that return Result and Error has been refactored. When manually implementing Code for cache key or value, please pay attention to how errors are handled as described in the interface comments.

Features and Enhances:

  • Refine hybrid cache read-related APIS.
    • New get() API: Replace the old obtain() API, support memory and disk cache read, request deduplication, and other optimizations. (The old get() API without disk cache request deduplication is deprecated.)
    • New get_or_fetch() API: Replace the old fetch() API, support memory and disk cache read, automatic cache refill on cache miss, request duduplication, and other optimizations.
    • Fix panics with race condition while using both get() (previously obtain()) and get_or_fetch() (previously fetch()) on the same key.
    • Refine error and result type with get_or_fetch() API.
  • Refine Source and Age preprotities. Now, Source refer to where the entry comes from, e.g. memory cache, disk cache, or outer; Age refer to the generation the entry is in the disk cache.
  • Refine Error type. Use OpenDAL-like error definition.
  • Auto implement Code for bytes::Bytes without serde feature.
  • Reduce task spawning on recovery.

Bug Fixes:

  • Fix panics when cancelling spawned fetch requests.
  • Fix string trimming when parsing io throttle.
  • Fix build on x86 targets.

Testing:

  • Support simulating io latency with psync io engine in foyer-bench.
  • Refine hybrid cache fuzzy test.

What's Changed

New Contributors

Full Changelog: v0.20.1...v0.21.0


This discussion was created from the release v0.21.0.