Skip to content

[ENH]: bump foyer to v0.17.2 #4473

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MrCroxx
Copy link
Contributor

@MrCroxx MrCroxx commented May 7, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Bump foyer to v0.17.2

Changes from v0.15.3 to v0.17.2:

  • Add metrics for large object disk cache indexer conflicts.
  • Refine the cache key/value serialization and deserializaion.
    • Support customized serialization and deserialization.
    • Support serialization and deserialization with serde and bincode. (optional)
  • Make serde and bincode optional, and disabled by default. You can enable it with serde feature.
  • Reduce verbose warning logs.
  • Fix panic when building large object disk cache engine if buffer_pool_size / flushers is not 4K-aligned.
  • Make CI run on release branches.
  • Refine entry-level properties.
    • Packing ephemeral, hint, location into CacheProperties and HybridCacheProperties, use insert_with_properties() and fetch_with_properties() for setting them.
    • Migration from foyer < v0.17.0: Repleace .insert_with_hint(..), .insert_ephemeral(..), etc with insert_with_properties(..) and fetch_with_properties(..).
  • Refine disk cache insertion with entries populated from the disk cache.
    • Use an age-based FIFO policy to manager large object disk cache.
    • Track the source of in-memory cache entries.
    • When an in-memory cache entry is being inserted into the disk cache, the disk cache will determine if to skip it according to its resource and age. Entries populated from the disk cache and are not going to evicted soon will be skipped.
  • Support flush entries in the in-memory cache to the disk cache on closing the hybrid cache.
    • Migration from foyer < v0.17.0: Enable by .with_flush_on_close(true) with the hybrid cache builder.
  • Refine io throttling.
    • Support advanced io throttling by read/write IOPS/throughput, and support count IOs by IO count or by IO count with IO size.
    • Migration from foyer < v0.17.0: Please set io throttling for device, instead of using RateLimiterAmissionPicker.
  • Support request deduplication and one-flight optimization with fetch(..) interface for the disk cache.
    • Migration from foyer < v0.17.0: Use .fetch_with_properties(..) API and set the location of HybridCacheProperties to Location::OnDisk.
  • Miscs:
    • Add builder() API for Cache and HybridCache to create builders.
    • Opt-out tracing dependency by default, enable it by enabling tracing feature.
    • Bump mixtrics to v0.1.
  • Refine load error handling to prevent from panics on disk data corruption.
  • Derive Partial, Eq for Throttle and IopsCounter.
  • Fix disk cache return wrong entry on key hash collision.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

Copy link

github-actions bot commented May 7, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor

propel-code-bot bot commented May 7, 2025

Upgrade Foyer Caching Library from v0.15.3 to v0.17.2

This PR upgrades the foyer caching library from v0.15.3 to v0.17.2, which includes several enhancements to the caching system. The upgrade introduces more refined cache key/value serialization, improved throttling mechanisms, and better management of disk cache entries. The PR also updates related dependencies and adapts the codebase to conform to API changes in the new version.

Key Changes:
• Upgrade foyer from v0.15.3 to v0.17.2 with new API patterns
• Removed RateLimitPicker in favor of Throttle in device options
• Enabled serde and tracing features in foyer dependency
• Added serialization test for Block type

Affected Areas:
• Cache configuration and management
• Disk caching IO control mechanism
• Serialization capabilities

This summary was automatically generated by @propel-code-bot

@HammadB HammadB enabled auto-merge (squash) May 12, 2025 20:14
@MrCroxx
Copy link
Contributor Author

MrCroxx commented May 14, 2025

Locate a bug with version v0.17.0 and v0.17.1, fixing it. I'll bump foyer directly to v0.17.2 later.

@HammadB HammadB disabled auto-merge May 14, 2025 14:30
@MrCroxx MrCroxx force-pushed the xx/foyer-v0.17.0 branch from e7a26b7 to 250f996 Compare May 15, 2025 05:57
@MrCroxx MrCroxx changed the title [ENH]: bump foyer to v0.17.0 [ENH]: bump foyer to v0.17.2 May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants