liuqian1990 / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

If memcached responds E2BIG, request should have no side effects #325

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When a user sends a "SET Key value" and the size of value is larger than the 
largest allowed value (e.g. 1024*1024+1 bytes), memcached sends a response of 
"Value Too Large."   The user should then reasonably expect that nothing has 
changed in the state of the cache.  

However Memcached 1.6 conflates this E2BIG case with an ENOMEM case, where 
there was no room to store the value, but at least the existing value can be 
expired.  So the end result is:
 User sends "SET key value"
 Memcached responds "Value Too Large"
 Memcached silently runs "DELETE key"

Original issue reported on code.google.com by john.david.duncan on 5 Jun 2013 at 4:56

GoogleCodeExporter commented 9 years ago
That was done on purpose a long time ago. People were complaining that 
memcached was silently not accepting SET's, and it shouldn't serve a stale 
cache in a few instances where sets internally fail. (it was silent for them 
since almost nobody checks for errors)

This is probably not great for folks running database engines where it's not 
necessarily a cache? :)

Original comment by dorma...@rydia.net on 5 Jun 2013 at 6:10

GoogleCodeExporter commented 9 years ago
not sure where we landed on this, but I know we talked about it elsewhere as 
well.

closing this out.

Original comment by dorma...@rydia.net on 28 Jul 2013 at 2:22