Jdesk / memcached

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

incr/decr resize corruption #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a really weird bug to report, first of all, this fixed it:
-        memcached_return ret = memcached_add(memcached_, key.c_str(),
key.length(), "1", 1, 7200, 0);
+        memcached_return ret = memcached_add(memcached_, key.c_str(),
key.length(), "00001", 5, 7200, 0);

These are then increased and decreased by 36 processes... And we found
that memcached can corrupt data when it handles a lot of data writes
and the data length (in characters) changes while another increase is
coming in.

get 0-2009072009-2-3705-SGFycnkgUG90dGVy
VALUE 0-2009072009-2-3705-SGFycnkgUG90dGVy 0 ??~59 END

that ?? is hex 90, A3 ... so basically garbage (yeah we have funny key
names). It should be just an integer. And not a big one at that, the
way the application is, it's never more than a two digits integer...
Since we changed the data width to 5 (overkill) things hold up. Weird,
as I said.

Original issue reported on code.google.com by dsalli...@gmail.com on 20 Jul 2009 at 3:34

GoogleCodeExporter commented 9 years ago
I'm marking this as "new" as opposed to "accepted" since "accepted" implies 
that the
problem has been reproduced.  Here I'm just recording something someone said and
would like to confirm that it's not actually a problem moving forward by 
writing some
tests for it.

Original comment by dsalli...@gmail.com on 4 Aug 2009 at 4:48

GoogleCodeExporter commented 9 years ago
I wrote a test that confirms that resizing itself does not cause corruption. 
Inspection of the current code doesn't show how this would be possible, so I'm
considering this an issue whose fix sprang miraculously from the many 
refinements
that have occurred in this area since the version this discussion was 
referencing
(which was, I believe an early 1.2).

Anyone who disagrees, please update the test.  :)

Original comment by dsalli...@gmail.com on 29 Oct 2009 at 7:00

GoogleCodeExporter commented 9 years ago
I'll close the bug for now, but feel free to reopen the bug if you can 
reproduce the
bug with 1.4.2 or newer.

Original comment by trond.no...@gmail.com on 29 Oct 2009 at 1:57