coreos / torus

Torus Distributed Storage
https://coreos.com/blog/torus-distributed-storage-by-coreos.html
Apache License 2.0
1.78k stars 172 forks source link

cache: update LRU cache when putting same key but different value #424

Open nak3 opened 7 years ago

nak3 commented 7 years ago

cache: update LRU cache when putting same key but different value

When same key but different value was put on the cache, current code doesn't replace the cache. This patch changes to find the same value cache and replace it when the same key cache was put.

lpabon commented 7 years ago

You probably want to force a removal of this element, then call Put() again instead.

nak3 commented 7 years ago

Thank you for your advice. I updated.

xiang90 commented 7 years ago

lgtm. defer to @lpabon. Can you take another look? Thanks.