When running operations like "copy, move, sync, etc" against a mounted remove (using vfs-cache=full) the operation is much slower than running against the remote itself (which is fine in general).
Typically we would read through a mounted "Cache" backend to give us the future benefit of cached meta, etc. which would make local fs to local fs operations much faster (also working around the exclusive lock challenges with Cache).
Any thoughts on what might happen with VFS caching in the future to help with non-related operations? (For instance, maybe adding vfs-cache=full option to the remote config file so that any and all operations take advantage of the existing vfs cache in the future?)
# time rclone copy -v --progress --fast-list RemoteCrypt:Media/ /srv/Media/
...
real 2m5.049s
# time rclone copy -v --progress --fast-list /mnt/RemoteCrypt/Media/ /srv/Media/
...
real 20m42.357s
Is the VFS cache thread / operation safe at this point? (concurrent operations against same remote)
Tested this again this morning with the latest build. I can still repro it. Still haven't got a smaller test case, but did capture a debug log this time. I've stripped out most of the copying/encrypting/uploading from the log to make it smaller, just including the start/end of each as a reference point. I can't quite make out a clear cause from the logs... possibly something with the new directory created not being in the cached listings at the right time? https://gist.github.com/dotsam/5c78df83f496f91d1d615d4480c97605
If this isn't conclusive, let me know, and I'll keep trying for a simplified case.
directory that the file is in was cleared from the cache
client asks to see the file
rclone re-reads the directory from the server
the file isn't there
BOOM
This is easy to replicate with vfs/forget and also not too surprising. The "virtual" directory entries rclone puts in for uploading files only live in the directory cache. This is so that when you do a list the file that you are uploading appears to be stored remotely, wheras it hasn't actually arrived in the remote yet.
There are two ways of fixing this - don't flush any directory cache entries with "virtual" items in. Or keep a separate note of the virtual entries... This is related to solving the restarted uploads disappearing problem too.
I'll have a think about this - expect a new beta shortly!
Stop virtual directory entries dropping out of the directory cache
a virtual directory entry is an entry rclone has made because it is uploading a file but that file hasn't actually appeared in a directory listing yet. Rclone has made these since the early days of the VFS - they aren't a new thing.
it also fixes the problem of disappearing directories on bucket based backends (like S3) which has been around for ages!
Add recovered items on cache reload to directory listings
this means that if you stop the mount while something is being uploaded, when you restart it the upload will restart and the file being uploaded will appear in the directory listings (it didn't before)
This latest beta seems to be working well for me. No issue with a file not showing in the mount while uploading anymore, no other errors. Thanks for all your work on this, Nick! Caching ain't easy!
What's the best way of purging the cache? vfs/forget seems to purge the directory structure but not the cache. Should I just remove the cache and metadata directories manually?
Thanks for the update. I'm getting some "context cancelled" errors in the logs after the update.
2020/06/24 02:05:39 ERROR : Media/tv/American Dad!/Season 17/American Dad! - S17E10 - Trophy Wife, Trophy Life WEBDL-1080p.mkv.partial~: Failed to copy: Post "https://www.googleapis.com/upload/drive/v3/files?alt=json&fields=id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails&supportsAllDrives=true&uploadType=resumable&upload_id=AAANsUkPHjFGZRQAu7hlpW2hRzgoEFxTNGikfRHvIxM8fwjVvfIFek6StjyGu6NS5pq613GDZk9Psouef5ST3VDRzHw": context canceled
2020/06/24 02:06:02 ERROR : Media/tv/American Dad!/Season 17/American Dad! - S17E11 - Game Night WEBDL-1080p.mkv.partial~: Failed to copy: Post "https://www.googleapis.com/upload/drive/v3/files?alt=json&fields=id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails&supportsAllDrives=true&uploadType=resumable": context canceled
2020/06/24 02:07:21 ERROR : Media/tv/The Daily Show/Season 25/The Daily Show - 2020-06-22 - June 22, 2020 WEBDL-1080p.mkv.partial~: Failed to copy: Post "https://www.googleapis.com/upload/drive/v3/files?alt=json&fields=id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails&supportsAllDrives=true&uploadType=resumable&upload_id=AAANsUlRzEH-cpPto8eGadywgb6MdiSOfr0EZlKIPEfv3pj5_jH3xFxht7EARbGocTy2AqBu9vdYgJwuzwWhEK9RQTs": context canceled
2020/06/24 02:08:24 ERROR : Media/tv/Late Night with Seth Meyers/Season 7/Late Night with Seth Meyers - 2020-06-22 - Jason Sudeikis, Mike O'Brien WEBDL-1080p.mkv.partial~: Failed to copy: Post "https://www.googleapis.com/upload/drive/v3/files?alt=json&fields=id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails&supportsAllDrives=true&uploadType=resumable&upload_id=AAANsUlMG7NGYCpDGgsAjlIupwvqBBzlGxvzuMimQss-y-J1Ezb2oycYURSK6rU42mHE9HFONXCy1jrN9_kGiz4CMC9NXcOGRg": context canceled
2020/06/24 02:09:01 ERROR : Media/tv/VICE News Tonight/Season 4/VICE News Tonight - 2020-06-22 - Monday, June 22, 2020 WEBDL-1080p.mkv.partial~: Failed to copy: Post "https://www.googleapis.com/upload/drive/v3/files?alt=json&fields=id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails&supportsAllDrives=true&uploadType=resumable&upload_id=AAANsUkV5f0X0PZT0FQsMnw-olbbfZB3QWCXRG8agBQ8qAmpgc7OMyx5_8usCE5pXzldEZYqcY4qtfT03exWONeksDA": context canceled
2020/06/24 02:10:32 ERROR : Media/tv/The Late Show with Stephen Colbert/Season 5/The Late Show with Stephen Colbert - 2020-06-22 - James Corden, Laura Benanti, Bright Eyes WEBDL-1080p.mkv.partial~: Failed to copy: Post "https://www.googleapis.com/upload/drive/v3/files?alt=json&fields=id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails&supportsAllDrives=true&uploadType=resumable&upload_id=AAANsUnnCi32xTN17lVJVSrqlp_hGz56DQyKaqmM8kpDdjjrSezzuitsrNDkSqAeXlzhZduimfoYMWr92i3JDTeMwUhKpDUoYQ": context canceled
In other news, there only appears to be one transfer going at a time now, eg:
Whatever's easiest but I think an rc API command is probably the most versatile. Maybe something like vfs/forget but augmented to not only bust the cache structure but also remove the files.
Those context cancelled errors are rclone deciding that it didn't need to upload that file because it got modified.
The fact that they are all .partial~ files is encouraging.
On 5 seperate mounts the "context cancelled" is only occurring on one, so I suspect it's not rclone related. The transfer is successful regardless of the error. thanks
Earlier you suggested I switch to --vfs-cache-mode full to benefit off your new features. I'd just like to confirm that using this cache is the most efficient way to mount read-only on Windows for media into a Plex server?
It does seem a piece of each file is saved to cache but updates can be painfully slow still. Which may not be avoidable. Command used is below, perhaps some parameters need to be adjusted if anyone can chime in. Appreciated it.
Guys, I took some time to test and I could see a problem that I'm not sure if it is this way of cache vfs. I use the rclone assembly exclusively for reading Plex, I do not have uploading this disc and when watching some content with subtitles (external or embedded), always when I get close to the end of the movie or episode the subtitle disappears, so I need to go back some second to get it working again. At first I thought it was a plex bug, but I tested it with the old way, and everything worked.
Below is the assembly I was using and had the problem with the subtitles.
[Unit]
Description = drive
After = network-online.target
I am trying to test the new vfs cache funcionality. I understand that using vfs-cache-model full should download chunks of a file and save these to disk. However, when I try to test this functionality, it appears that rclone will download the entire file at once before I can open the file.
I am on Windows 10 and I am using rclone v1.52.2-132-g61e4b4db-beta. I mount my crypt google drive with the following command:
Whenever I open up a folder in the mount that contains a media file in Windows Explorer (WE), it will hang until the whole file has been downloaded. I know WE is probably trying to read media info off the file, but I would expect that would only read a few 'chunks' of the file to get this?
Also, if I open a media file with VLC, it will also hang until the entire file has been downloaded. I know this because of (1) the time it takes to open and (2) If I go into the cache folder, I can open the local media file and play it in its entirety from start to finish, with no delay.
Is this as intended and have I misunderstood how the new vfs cache should work? I was hoping that if I started watching a video file, it would only download the initial chunks to start video playback. These would be kept on disk so I could instantly rewind a few minutes without having to re-download any of the video file.
Let me know if you believe this could be an issue on my end and I will post a log file.