On Mon, Dec 21, 2009 at 2:50 PM, StephenChan <[email protected]> wrote:
> Actually, my situation is something like "data recovery", before I save the
> data into database, I executed "flush_all" command,
> and now I need to get the data of the memory and push them into database. As
> the ref says, "The most precise definition of
> what flush_all does is the following: it causes all items whose update time
> is earlier than the time at which flush_all was set
> to be executed to be ignored for retrieval purposes." . The memcached just
> ignored the get request for the data that have
> been flushed, according to the update time, but the data remains intact in
> memory, besides to gcore the memcached process
> image, is there any other way such as change os time or something to recovery
> the data from memory ?
As I they said, it is cache, not storage. You should be prepared to
lost the data in the memcached without any serious problem.
Anyway, if it is your only way out, you can, but it is not easy.
Changing the box time wouldn't help: the oldest_live variable is set
to the current time at the moment of the flush_all execution:
if (c->binary_header.request.extlen == sizeof(req->message.body)) {
exptime = ntohl(req->message.body.expiration);
}
set_current_time();
if (exptime > 0) {
settings.oldest_live = realtime(exptime) - 1;
} else {
settings.oldest_live = current_time - 1;
}
item_flush_expired();
You could if (c->binary_header.request.extlen ==
sizeof(req->message.body)) {
exptime = ntohl(req->message.body.expiration);
}
set_current_time();
if (exptime > 0) {
settings.oldest_live = realtime(exptime) - 1;
} else {
settings.oldest_live = current_time - 1;
}
item_flush_expired();
As far as I understand the code, the item_could_flush_expired could
unlink items, so you could have lost some of them.
As said before, you could try dumping the process and walking the
internal memory structures. Not an easy process and definitevely
without any warranty.
Carlos.