in reply to Re^2: PerlMonks Caching (data)
in thread PerlMonks Caching
except for the race condition which might hardly ever be noticed or might be quite an annoyance that other users of memcached don't run intoI didn't get that race condition anyway. Especially the "flush to memcached".
edit: yes, I think that's the point - in the second block of server X you are flushing N2 to memcached, but the current version in the databse is N4. If creating the cache entry only when fetching a thread the RC shouldn't be there.
edit 2:
or maybe I can still create an RC:
But that version must have a whole transaction and redirect and memcached operation in between that X blocks. of course, it's still possible, but extremely improbable. Could maybe be prevented by putting the read and creating the cache entry into a transaction with read lock?X: reads thread with node N1 X: votes N1 -> N2, delete cache entry X: redirect after POST and reads N2 from DB... Y: author updates node from N2 to N3 Y: delete cache entry, if exists Y: redirect after POST and reads N3 from DB Y: cache N3 to memcached X: ... cache N2 to memcached
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: PerlMonks Caching (still racy)
by tye (Sage) on Apr 21, 2010 at 18:44 UTC | |
by tinita (Parson) on Apr 21, 2010 at 19:43 UTC | |
by tye (Sage) on Apr 21, 2010 at 20:52 UTC | |
by tinita (Parson) on Apr 21, 2010 at 22:14 UTC | |
by tye (Sage) on Apr 22, 2010 at 04:17 UTC | |
| |
by tinita (Parson) on Apr 21, 2010 at 18:54 UTC | |
|
Re^4: PerlMonks Caching (locks--)
by tye (Sage) on Apr 22, 2010 at 07:47 UTC |