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

memcache drivers: a long-running process will not "sense" cache-clears from other processes #116

Closed
gggeek opened this issue Dec 2, 2013 · 1 comment

Comments

@gggeek
Copy link
Contributor

gggeek commented Dec 2, 2013

Imagine the following scenario:

  1. process A caches item X/Y/Z => item gets saved in memcache, "curent revision" for X/, X/Y and X/Y/Z saved in both memcache and process memory. Process keeps running
  2. process B invalidates X/Y. This means bumping the revision nr of X/Y in memcache
  3. process A reads cache for item X/Y/Z => it takes from memory the revision number, and considers the stale item still valid

I am not sure 100% about the best way to solve this.
One way would be to add a "global counter" as memcache item, which gets bumped on every invocation of clear(). Then, it would have to always be checked in makeKeyString() before using the in-memory version of revision numbers.
A small pref loss (1 more memcache get per read/write) for more stability

tedivm added a commit that referenced this issue May 13, 2014
@tedivm
Copy link
Member

tedivm commented May 14, 2014

The new functionality automatically clears the key cache cache every second, and allows that time to be reduced and even disabled (by setting it to zero).

@tedivm tedivm closed this as completed May 14, 2014
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

No branches or pull requests

2 participants