From f1f94749bd8b5525bc01ad6497b292fdd72a224b Mon Sep 17 00:00:00 2001 From: Martin Polanka Date: Fri, 4 May 2018 18:20:50 +0200 Subject: [PATCH] Last modification time used instead of access time in cleaner and worker --- Analysis.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Analysis.md b/Analysis.md index 9be15a5..37936cb 100644 --- a/Analysis.md +++ b/Analysis.md @@ -1079,13 +1079,13 @@ But unlike last modification time, last access time is not usually enabled on conventional filesystems (more on this subject can be found [here](https://en.wikipedia.org/wiki/Stat_%28system_call%29#Criticism_of_atime)). So if we choose to use last access time, filesystem used for cache folder has to -have last access time for files enabled. Last access time was chosen for -implementation in ReCodEx but this might change in further releases. +have last access time for files enabled. With respect to this access time was +not chosen for implementation. However, there is another way, last modification time which is broadly supported can be used. But this solution is not automatic and worker would have to 'touch' -cache files whenever they are accessed. This solution is maybe a bit better than -the one with last access time and might be implemented in future releases. +cache files whenever they are accessed. This solution is kind of built-in and +was chosen instead of last access time for the latest releases. #### Caching Flow @@ -1103,11 +1103,11 @@ First start with worker implementation: - worker discovers fetch task which should download supplementary file - worker takes name of file and tries to copy it from cache folder to its working folder - - if successful then last access time should be rewritten (by filesystem - itself) and whole operation is done + - if successful then last modification time is rewritten by worker itself + and whole operation is done - if not successful then file has to be downloaded - - file is downloaded from fileserver to working folder and then - copied to cache + - file is downloaded from fileserver to working folder + - then file is copied into temporary file and moved (atomically) to cache Previous implementation is only within worker, cleaner can anytime intervene and delete files. Implementation in cleaner follows: @@ -1117,10 +1117,10 @@ delete files. Implementation in cleaner follows: age - there is a loop going through all files and even directories in specified cache folder - - if difference between last access time and reference timestamp is greater - than specified maximal file age, then file or folder is deleted + - if difference between last modification time and reference timestamp is + greater than specified maximal file age, then file or folder is deleted -Previous description implies that there is gap between detection of last access +Previous description implies that there is gap between detection of last modification time and deleting file within cleaner. In the gap there can be worker which will access file and the file is anyway deleted but this is fine, file is deleted but worker has it copied. If worker does not copy whole file or even do not start to