[Linux-cachefs] Actually persistent? How?

a a x5q9b8n384 at yahoo.com
Mon Feb 1 04:40:25 UTC 2016


Hi...
I am trying to use the user space daemon cachefilesd with NFS/FS-Cache. I have read in many places that this cache uses local disk space so as to be persistent across reboots of the client. I am using it as both read and write as a primary means of guaranteeing that files written to the server will not be corrupted due to network glitches. What I cannot find out anywhere that I have looked is the way to actually use this persistence.
I have 2 use cases. In both, I am running the latest Ubuntu Linux on both client and server. I am writing a very large file to the NFS server through the mount point. This works just fine.1. In the middle of writing, I disable the network interface for the server. What seems to happen is that the writing continues from the client into the local cache and the application (in this case the "cp" command) received an "all ok", meaning that the file has been written successfully. When I restore the NFS server network interface, the caching and NFS client seem to recover and when I check next on the server after a small bit of time, the file exists remotely and is complete and uncorrupted. This seems to work fine and I have no further issues with this use case (assuming that this is actually what happens; I need to perhaps run more tests and verify that NFS actually resumes data writing to the server when the connection is restored.)

2. In the second use case, I run the same operation (writing a large file, cutting off the server network connection) and I get back an "all ok" as before. This time, I shutdown the client, restore network capability to the server and then re-start the client. At this time, I do not get any further automatic synchronization and the file I was trying to write out is corrupted on the server. It seems that starting cachesfilesd kills the cache including dirty blocks.
Is there any way to have this second use case work by coming up when the client is restarted, recognize that there are still dirty cache elements and sync them up to the server automatically?
Is this even possible? Is this supposed to work? Have I missed something or need to run some sort of different test?
If not, my question then is, why bother having a persistent cache that is supposedly coherent over reboots of the client if executing cachefilesd simply zaps the cache as its first operation?
Hoping this is something that could be answered simply. Thanks in advance.
George




More information about the Linux-cachefs mailing list