Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does cachelib support persist cache by call specific API? #110

Closed
yiguolei opened this issue Jan 17, 2022 · 2 comments
Closed

Does cachelib support persist cache by call specific API? #110

yiguolei opened this issue Jan 17, 2022 · 2 comments

Comments

@yiguolei
Copy link

Currently, cachelib could persist cache by call shutdown api. But if the process is killed by 'kill -9', then no signal could be catch by the process so that could not call shutdown api.

Does cachelib have an persistence API and the application could call it periodically? And could load the cache even if the process is killed by 'kill -9'? The cache is not up to date is accepted.

@leozzx
Copy link
Contributor

leozzx commented Jan 18, 2022

no, cachelib doesn't support online backup. Could you explain why do you need persistence in the case of "kill -9"?

@sathyaphoenix
Copy link
Contributor

Unlike storage engines, cachelib does not offer crash consistent storage of items. for caches, this is not a deal breaker since durability is not a prime concern for the cache. Besides, caches operate with background evictions, so the application already expects the cache to be empty or missing items. In steady state, cachelib has DRAM data structures that need to be persisted for recovery on restart. If a cache process is receiving a kill -9, we can not guarantee the state of these DRAM data structures to be consistent for shutdown. So I would not recommend catching the kill signal and doing a shutdown unless you can guarantee that the application threads have stopped accessing the cache and shutdown api can be safely called.

There is an internal experimental feature, but it is not the "kill -9" feature you are probably looking for. With that you can snapshot the cache by shutting it down (after ensuring application thread stop accessing cache) and copying the state to another machine to bootstrap another cache from it.

@facebook facebook locked and limited conversation to collaborators Jan 18, 2022
@sathyaphoenix sathyaphoenix converted this issue into discussion #113 Jan 18, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants