Details
Description
When doing a set() with a value larger than 1MB to a memcache bucket, moxi crashes and responds with MEMCACHED_WRITE_FAILURE on all following requests.
A restart of the Couchbase server is needed to get up and running again.
This can be avoided by checking the size of the value before doing a set() to Couchbase, but that is not viable when doing append/prepend, as you do not know the size of the current value. I.e if you do a 10kb append() to a key that already holds 999kb of data, the same crash happens.
When doing the same against standard memcache, the server responds with a MEMCACHED_NOTSTORED without crashing, as expected.
Use the following PHP-code to reproduce:
$m = new Memcached();
$m->addServer('localhost', 11211);
$m->set('key', str_repeat('x', 1049000));
Run it a couple of times and moxi will start responding with MEMCACHED_WRITE_FAILURE even if you try to set small keys.
Test the append() issue with this code:
$m = new Memcached();
$m->addServer('localhost', 11211);
$m->set('key', str_repeat('x', 1048000));
$m->append('key', str_repeat('y', 20000));