Comment #1 on issue 249 by [email protected]: Problem of reclaiming valid
items.
http://code.google.com/p/memcached/issues/detail?id=249
One more minor thing..
In do_item_get() function,
following code is used to check whether the fetched item is valid.
if (it != NULL) {
if (settings.oldest_live != 0 && settings.oldest_live <=
current_time &&
it->time <= settings.oldest_live) {
do_item_unlink(it, hv);
do_item_remove(it);
it = NULL;
if (was_found) {
fprintf(stderr, " -nuked by flush");
}
} else if (it->exptime != 0 && it->exptime <= current_time) {
do_item_unlink(it, hv);
do_item_remove(it);
it = NULL;
if (was_found) {
fprintf(stderr, " -nuked by expire");
}
} else {
it->it_flags |= ITEM_FETCHED;
DEBUG_REFCNT(it, '+');
}
}
In the above code,
"it->time <= settings.oldest_live" is used
instead of "it->time < settings.oldest_live".
So, it might be better to use the same condition in the code of
do_item_alloc().