rclone/fs
Leo Luan c665201b85 vfs: support synchronous cache space recovery upon ENOSPC
This patch provides the support of synchronous cache space recovery
to allow read threads to recover from ENOSPC errors when cache space
can be recovered from cache items that are not in use or safe to be
reset/emptied .

The patch complements the existing cache cleaning process in two ways.

Firstly, the existing cache cleaning process is time-driven that runs
periodically. The cache space can run out while the cache cleaner
thread is still waiting for its next scheduled run. The io threads
encountering ENOSPC return an internal error to the applications
in this case even when cache space can be recovered to avoid this
error. This patch addresses this problem by having the read threads
kick the cache cleaner thread in this condition to recover cache
space preventing unnecessary ENOSPC errors from being seen by the
applications.

Secondly, this patch enhances the cache cleaner to support cache
item reset. Currently the cache purge process removes cache
items that are not in use. This may not be sufficient when the
total size of the working set exceeds the cache directory's
capacity. Like in the current code, this patch starts the purge
process by removing cache files that are not in use. Cache items
whose access times are older than vfs-cache-max-age are removed first.
After that, other not-in-use items are removed in LRU order until
vfs-cache-max-size is reached. If the vfs-cache-max-size (the quota)
is still not reached at this time, this patch adds a cache reset
step to reset/empty cache files that are still in use but not
dirtied.  This enables application processes to continue without
seeing an error even when the working set depletes the cache space
as long as there is not a large write working set hoarding the
entire cache space.

By design this patch does not add ENOSPC error recovery for write
IOs. Rclone does not empty a write cache item until the file data
is written back to the backend upon close. Allowing more cache
space to be consumed by dirty cache items when the cache space is
already running low would increase the risk of exhausting the cache
space in a way that the vfs mount becomes unreadable.
2020-08-25 21:12:06 +01:00
..
accounting accounting: fix deadlock in stats printing 2020-08-05 17:13:00 +01:00
asyncreader build: fix tests on go1.15 2020-07-25 18:51:28 +01:00
cache fs/cache: fix moveto/copyto remote:file remote:file2 2020-07-02 10:55:36 +01:00
chunkedreader doc: fix typos throughout docs and code 2020-05-25 11:23:58 +01:00
config build: make rclone build with wasm 2020-08-10 17:32:21 +01:00
dirtree build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
driveletter Break the fs package up into smaller parts. 2018-01-15 17:51:14 +00:00
filter doc: fix typos throughout docs and code 2020-05-20 15:54:51 +01:00
fserrors vfs: support synchronous cache space recovery upon ENOSPC 2020-08-25 21:12:06 +01:00
fshttp lib/structs: factor reflection based structure manipulation into a library 2020-06-10 12:28:48 +01:00
fspath fs: fix formatting of errInvalidCharacters error message 2020-06-16 15:08:09 +01:00
hash hash: fix hash names for DropboxHash and CRC-32 2019-10-30 12:20:10 +00:00
list build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
log build: make rclone build with wasm 2020-08-10 17:32:21 +01:00
march march: added flag to allow Unicode filenames to remain unique 2020-05-15 12:28:01 +01:00
object Remove backend dependency from fs/hash 2019-10-01 16:29:58 +01:00
operations rc: fix rc/uploadfile only working for root of the fs 2020-08-10 17:09:46 +01:00
rc plugins: Add url query params to regex for referrer path 2020-08-24 10:56:04 +01:00
sync accounting: Allow transfers to be canceled with context #3257 2020-07-28 16:41:17 +01:00
version build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
walk build: fix tests on go1.15 2020-07-25 18:51:28 +01:00
bwtimetable.go fs: added weekday schedule into --bwlimit - fixes #1822 2018-06-17 18:38:09 +01:00
bwtimetable_test.go fs: added weekday schedule into --bwlimit - fixes #1822 2018-06-17 18:38:09 +01:00
config.go fs: add --bwlimit-file flag to limit speeds of individual file transfers 2020-07-28 11:46:24 +01:00
config_list.go Make flags show up with their proper names, eg SizeSuffix rather than int 2019-02-07 11:57:26 +00:00
config_list_test.go fs: fix tests for *SepList 2018-08-21 10:58:59 +01:00
cutoffmode.go fs: Use --cutoff-mode hard,soft,catious instead of 3 --max-transfer-mode flags 2020-03-01 09:49:55 +00:00
cutoffmode_test.go fs: Use --cutoff-mode hard,soft,catious instead of 3 --max-transfer-mode flags 2020-03-01 09:49:55 +00:00
deletemode.go Break the fs package up into smaller parts. 2018-01-15 17:51:14 +00:00
dir.go Add context propagation to rclone 2019-06-19 11:59:46 +01:00
direntries.go fs: Allow sync of a file and a directory with the same name 2019-06-09 15:57:05 +01:00
direntries_test.go build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
dump.go Make flags show up with their proper names, eg SizeSuffix rather than int 2019-02-07 11:57:26 +00:00
dump_test.go Fix broken flag type tests 2019-02-07 16:42:26 +00:00
fingerprint.go fs: add Fingerprint to detect changes in an object 2020-06-30 12:01:36 +01:00
fingerprint_test.go fs: add Fingerprint to detect changes in an object 2020-06-30 12:01:36 +01:00
fs.go fs: Add directory to optional Purge interface - fixes #1891 2020-07-31 17:43:17 +01:00
fs_test.go fs: Add directory to optional Purge interface - fixes #1891 2020-07-31 17:43:17 +01:00
log.go fs: generalise machinery for putting extra values when using --use-json-log 2020-04-11 18:16:21 +01:00
log_test.go Break the fs package up into smaller parts. 2018-01-15 17:51:14 +00:00
mimetype.go Add context propagation to rclone 2019-06-19 11:59:46 +01:00
options.go doc: fix typos throughout docs and code 2020-05-20 15:54:51 +01:00
options_test.go fs: fix FixRangeOption so it doesn't add HTTPOptions in place of bad Ranges 2020-04-24 12:32:09 +01:00
parseduration.go fs: allow --min-age/--max-age to take a date as well as a duration 2020-05-12 17:49:33 +01:00
parseduration_test.go fs: allow --min-age/--max-age to take a date as well as a duration 2020-05-12 17:49:33 +01:00
sizesuffix.go fix spelling 2019-04-30 14:12:18 +02:00
sizesuffix_test.go fs: Implement Scan method for SizeSuffix and Duration 2018-07-16 08:50:52 +01:00
version.go Start v1.52.3-DEV development 2020-08-08 10:35:06 +01:00
versioncheck.go build: update to use go1.14 for the build 2020-02-26 21:26:47 +00:00