Last modification time used instead of access time in cleaner and worker

master
Martin Polanka 7 years ago
parent 56b2870e51
commit f1f94749bd

@ -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 conventional filesystems (more on this subject can be found
[here](https://en.wikipedia.org/wiki/Stat_%28system_call%29#Criticism_of_atime)). [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 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 have last access time for files enabled. With respect to this access time was
implementation in ReCodEx but this might change in further releases. not chosen for implementation.
However, there is another way, last modification time which is broadly supported 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' 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 cache files whenever they are accessed. This solution is kind of built-in and
the one with last access time and might be implemented in future releases. was chosen instead of last access time for the latest releases.
#### Caching Flow #### Caching Flow
@ -1103,11 +1103,11 @@ First start with worker implementation:
- worker discovers fetch task which should download supplementary file - worker discovers fetch task which should download supplementary file
- worker takes name of file and tries to copy it from cache folder to its - worker takes name of file and tries to copy it from cache folder to its
working folder working folder
- if successful then last access time should be rewritten (by filesystem - if successful then last modification time is rewritten by worker itself
itself) and whole operation is done and whole operation is done
- if not successful then file has to be downloaded - if not successful then file has to be downloaded
- file is downloaded from fileserver to working folder and then - file is downloaded from fileserver to working folder
copied to cache - then file is copied into temporary file and moved (atomically) to cache
Previous implementation is only within worker, cleaner can anytime intervene and Previous implementation is only within worker, cleaner can anytime intervene and
delete files. Implementation in cleaner follows: delete files. Implementation in cleaner follows:
@ -1117,10 +1117,10 @@ delete files. Implementation in cleaner follows:
age age
- there is a loop going through all files and even directories in specified - there is a loop going through all files and even directories in specified
cache folder cache folder
- if difference between last access time and reference timestamp is greater - if difference between last modification time and reference timestamp is
than specified maximal file age, then file or folder is deleted 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 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 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 worker has it copied. If worker does not copy whole file or even do not start to

Loading…
Cancel
Save