Doloops / mcachefs

mcachefs : Simple filesystem-based file cache based on fuse
65 stars 15 forks source link

Persistence and flushing #4

Open mandolaerik opened 6 years ago

mandolaerik commented 6 years ago

Hi, Thanks for a nice FS, it saves my day. My use case is read-only NFS access to a huge file server, which I need to access while disconnected (or when on a slow connection). Files on the server side change sometimes, maybe once a month.

I'm missing a flushing feature: The file server contains some huge files that I only need occasionally, and which I normally don't want to keep in my cache. It would be nice if I could flush them somehow (e.g., 'echo foo/bar > /cached/.mcachefs/flush' to recursively flush all directories and files under /cached/foo/bar)

The file server also contains files that I want to keep in the cache indefinitely. So a flushing feature needs a way to configure "pinned" files I want to keep.

If "pinned" files/directories are supported, then ideally a metadata_flush should trigger a metadata re-read (and re-fetch if files have changed) of all pinned paths, to make sure it's all up-to-date.

I'll be happy to try contributing this feature, if you can suggest a design that fits into your larger picture of mcachefs development.

hradec commented 5 years ago

Nice idea...

Just so you known, I'm planning on write a separated thread or daemon to take care of checking for updates on the backend for the already cached files and folders, and re-synchronize it to keep the cache up 2 date, without interfering with mcachefs main loop.

That would sort out your problem, since the thread/daemon would detect that a file you already have in the cache has changed in the backend, so it would re-transfer it automatically, in the background for you.

but I don't have a timetable for that... #10