catfs icon indicating copy to clipboard operation
catfs copied to clipboard

writeback support

Open kahing opened this issue 8 years ago • 2 comments

the "simple" implementation would be logging all the dirty files and copy back in the background, while making sure they are never evicted. Ideally provide ways to let the user know how much dirty data are yet to be replicated

kahing avatar Aug 21 '17 08:08 kahing

I'm considering implementing this feature and I'm wondering if you have a precise idea about how to "log" dirty files.

lelongg avatar Jun 26 '18 22:06 lelongg

I think a naive solution probably works fine. So just a list of file names (separated by '\0') every time it's changed. We keep the list of dirty files in memory. Every time a new file is modified a new file name is appended to this file (unless it's already there). We have another file that contains nothing but an offset, and every time we copy back we update this offset. Periodically we rollover to a new set of files.

So the file names are something like:

dirtylog_v1.log.00000000
dirtylog_v1.checkpoint.00000000
...
dirtylog_v1.log.0000000F
dirtylog_v1.checkpoint.0000000F

kahing avatar Jul 01 '18 22:07 kahing