You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the final file is saved after a download and the same cache is used with a new flist, if theses files are still there, they won't be updated, even if blocks have changed.
The only thing, sure to be unique and unmodified, is a block file. Each file have one or multiple block. This block contains integrity hash and encryption key.
It would make sens for me, to save each blocks (uncrypted, to avoid doing this all the time) and providing the right portion of file requested by the system, by reading blocks. Not keeping the final file.
In this way, we can always ensure the blocks integrity and if a final file have changed, this will be seen by the 0-fs, because one hash won't be there.
Actually saving file blocks instead of full file makes more sense and was considered before. Except it will give very bad performance. Also the way the fuse layer work now when a file is accessed, is be passing the open file descriptor to the fuse module fully hence it works like a proxy.
If we start saving the file as blocks we will have to handle all read, and seek operations and all will have to go through the 0-fs process, reducing performance.
It still can be done though, but we will have to do some benchmarking to see how much it will affect the performance.
That's also the feeling I have about this. Re-assembling blocks will make things way slower I think.
Although @maxux had a point when he said that the syscalls to read a file give the offset and size, so we could just give the proper blocks.
But indeed benchmarking needs to be done to make sure we still get enough performance from this
This commit 19b8df0 , is an improvement already on this. but it doesn't fix the issue of corrupted files (disk failure) or other causes of corruption once the file is downloaded. Hence a full cache check on boot should be implemented.
As mentioned above, the storing of the individual blocks can cause a huge impact, i can still give it a try. A check against the file hash on boot can be a better solution, but will cause a boot delay ...
This issue is related and created because of:
If the final file is saved after a download and the same cache is used with a new flist, if theses files are still there, they won't be updated, even if blocks have changed.
The only thing, sure to be unique and unmodified, is a block file. Each file have one or multiple block. This block contains integrity hash and encryption key.
It would make sens for me, to save each blocks (uncrypted, to avoid doing this all the time) and providing the right portion of file requested by the system, by reading blocks. Not keeping the final file.
In this way, we can always ensure the blocks integrity and if a final file have changed, this will be seen by the 0-fs, because one hash won't be there.
Cc @zaibon for follow-up.
The text was updated successfully, but these errors were encountered: