Skip to content
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

store/cache: drop updates to existing items and dedupe get/set methods #1142

Merged
merged 1 commit into from
May 16, 2019
Merged

Commits on May 15, 2019

  1. store/cache: drop updates to existing items and dedupe get/set methods

    When an item was successfully updated, metrics and cache size tracking added the new version of the item but did not remove the old version of the item, so it was over-counted.
    
    For example, with a fresh cache, if you set the same item m times with each version having entry size n, the cache would think it had m items with current size m*n instead of 1 item with current size n.
    
    If you then emptied the cache by evicting every item (only one), the cache would think it had m-1 items with current size (m-1)*n, instead of 0 items with current size 0.
    
    This would allow the cache to get stuck in an eviction loop which persists even after the cache has been emptied.
    abursavich committed May 15, 2019
    Configuration menu
    Copy the full SHA
    964e362 View commit details
    Browse the repository at this point in the history