Large multiget requests randomly broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
memcached (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Lucid |
Fix Released
|
High
|
Unassigned |
Bug Description
== SRU REPORT ==
IMPACT: users who try to use memcached with large multi-gets will get a cache miss every time.
TEST CASE:
* install php5-cli and php5-memcached
* run this code using 'php':
$m = new Memcached();
$m->addServer(
$keys = array();
for ($i=0; $i<50000; $i++) {
$key = 'xxxxxxxxxxxxxx
$keys[] = $key;
}
$result = $m->getMulti($keys, $cas);
var_dump($result, $cas);
var_dump(
* Result if affected by bug will be:
bool(false)
NULL
int(19)
* Result if fixed will be:
array(0) {
}
array(0) {
}
int(0)
REGRESSION POTENTIAL: This change makes the patch *more* like the upstream fix, which has been in every version of memcached since Ubuntu 10.10, and has not caused regressions.
======
Binary package hint: memcached
* Ubuntu release.
Description: Ubuntu 10.04 LTS
Release: 10.04
* How to reproduce the bug?
Send several large multiget requests to a Ubuntu 1.4.2 Memcached server, and you'll notice that some of them will break, and other will return only a subset of the requested keys. You can use the following PHP test code:
$m = new Memcached();
$m->addServer(
$keys = array();
for ($i=0; $i<50000; $i++) {
$key = 'xxxxxxxxxxxxxx
$keys[] = $key;
}
$result = $m->getMulti($keys, $cas);
var_dump($result, $cas);
var_dump(
* How to fix de bug?
Rebuilding the server without the fix-issue-
Carlos, thanks for taking the time to file this bug report.
I was able to confirm this on lucid only. It is working fine in Maverick and Natty.
Since its hard to know that this is affecting you, and memcached can potentially be used as a sort of data store, I'm marking it as High Importance.