-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"hasUpdated" function is not being called from the OC root folder for mounted FSs #5036
Comments
@icewind1991 any idea? Can you please have a look? THX |
This is intended behavior, |
Okay - but this will result in not up to date information like mtime |
I had some issues with the desktop client regarding this, because I think they only check the mtime of the OC root folder to trigger the synchronization. Other clients might present the same issue. Using only the desktop client, you can upload a file as described but you'll never get it in the desktop. You'll need to use the web interface and/or other clients. |
this is most probably related to etag propagation - this requires some more testing |
@PVince81 What do you think? |
@icewind1991 Can you look into this? |
@icewind1991 What do you think? |
Calling Having a background job call |
The performance issue are understandable and valid if we talk about real physical external storage (Like amazon etc.) but does this apply to external storages which live in the same network/server? On bigger installations even the user's root can already be mounted to e.g. a lokal SWIFT/OpenStack storage. |
That isn't as much of a problem because we only need to check one storage, if we were to check all storages in a folder there is no real limit to the amount of storages we need to check. Also there is a big difference in the folder you're currently browsing being out of date, or some folders in the webui having an out-dated mtime. |
Not sure if related to this, but I found out that whenever I edit a file on a SMB storage, the change isn't picked up by the sync client. Every call from the sync client asks for changes in "files" which aren't there since the etag isn't affected by changed inside mountpoints. We need to find a good solution for this, as this makes syncing incompatible with external storages, which partly defeats the purpose of having external storages in the first place. |
(unless one doesn't use the sync client) |
The problem also exists if you modify files directly in the "data" dir, but inside a subdir. It does seem that detecting external changes is difficult, especially when the change isn't directly in the root of the storage. |
One possible idea: for every ext storage mountpoint, return a special flag to the sync client. For example: "X-OC-FolderType: Mountpoint" This way the client knows that it's an ext storage mountpoint and it could then do a PROPFIND on that one if necessary, which should trigger the "hasUpdated" call. |
Or alternatively the mount points could be checked either:
What do you think @icewind1991 ? |
Just checking the mount point wont fix the issue of changes not being detected |
So it seems a full rescan is needed in most cases, which is expensive. 😦 |
This issue was reported by many different users here: #7955 |
@icewind1991 would a cron job that regularily runs the scan CLI command fix this ? |
Thanks to @PVince81, who pointed me here from another thread. I've been struggling at setting up ownCloud (read) access to my nightly backups, to save logging in via SSH to check/get them. In this struggle I noticed that external local storage can easily be mounted successfully, but often does NOT notice changes to files in such directories. I use a rotational backup principle which overwrites files in the same target directories. So the directory itself seems unchanged, the files are the same in name and number, only their size and mtime have changed. ownCloud Server UI definitely does NOT notice these changes - it tells me that files are say 1 month old, when in SSH I can see that they are from yesterday. I have found a workable solution by having these mounts visible to a "Backups" user and a cron job to do a files:scan for the "Backups" user daily at 5am. So it now works for me, but was difficult to understand and not the easiest thing to design a working strategy with the current features. Would it not be easy enough to simply (re)scan the local external directory when it is entered at the UI? Or any other type of external storage which allows non-costly directory scans? Many thanks to all those who have contributed to ownCloud - a great product getting better! |
@timreeves I think the current code already does a shallow scan whenever the user navigates into a directory. Shallow scan means that it will ask the ext storage whether the folder's mtime has changed. If yes, it will go into that dir and update the cache with the changed files. One problem though is that if a file is modified but not renamed, the folder mtime will not change, so the scanner won't pick up the changes. It might be possible to improve this by force-scanning not only the folder but also its contents. Still, since mtime isn't propagated up to the root by most filesystems, the shallow scanner cannot find out about deeper changes by just scanning the root folder. Needs further research. @icewind1991 told me recently that there is a notification API. Not sure how it works. But it makes it possible for external apps to trigger scanning on specific folders. If SMB or other ext storage have a mechanism to send notifications on changes (like inotify on Linux FS), it could be used to trigger the scanner on specific folders. |
@timreeves and what I forgot to mention, the sync client only checks for changes on the root (etag change), so if deeper change notifications cannot be propagated to the root, the sync client won't know either. |
@PVince81 Ha thanks for that good tip about the shallow scan, which I have now tested and it seems you are right - all I needed to add to my backup script was a "touch" of all the target directories involved!
|
@icewind1991 @DeepDiver1975 if we introduce external storage options as per #12216 we could add an option "do a full rescan of this storage on a regular interval" ? The interval should probably be configurable so admins could decide how important/timely the change detection needs to be. Then the full rescan would be done in a background job (cron). |
This would at least solve the potential performance issue mentionned here #5036 (comment) in case of multiple storages. Assuming that not all ext storages are important. Additionally this means that the option is only needed for storages that are used outside of ownCloud. If some storages are using exclusively through ownCloud, they wouldn't need that option and wouldn't cause any performance issue. |
@PVince81 thanks for your reply. I can't tell 1000+ users to use selective sync to disable their whatever-named external storage. I need a centrally managed workaround. |
@icewind1991 how about a new option for "occ files:scan" to scan a specific storage id ? (like an external storage mount point). Then admins could put this in a cron job as a workaround to force rescan every 10-15 minutes. |
If I remember well this issue here was mostly about calling "hasUpdated()". So at least the CLI tool (or whichever solution we use) could at least run hasUpdated() on every known external storage roots. |
Workaround for local SMB shares from #8892: |
Well thing is that the scanner will rescan all home folders, not only the remote ones. |
this method : ./occ files:scan --all does not function when the share is mounted with SMB / CIFS. |
We only use SMB for WEB access outside company + sharing with ppl outside our company, having it synchronised is not possible casue its never up2date on your laptop because changes are not seen by the client. Just wondering, how does the enterprise version do this? (in case of SMB?) |
"Just wondering, how does the enterprise version do this? (in case of SMB?)" Same problem between enterprise and community version :( . |
OK.. i thought in the enterprise edition it was not an issue... i meant the Windows Shares plugin in the enterprise, does this function have similar issues? |
Nop i tested this version and the same error appears. I think, the core is the same between the community and enterprise edition. |
Ok, i thought those were 2 different plugins: https://owncloud.com/features/#WindowsNetworkDrive where the "SMB/CIFS" feature of the Community Edition is available here: |
They are different plugins, but detecting remote updates is a general problem for every external storages, nothing specific to the plugin implementations, more something in core. |
ok that makes sense thanks, in 8.1 there will be improvement right? |
8.1 will contain some new switches for external storages to tell how often the rescan needs to be done (never, detect changes (default), on every access). But I'm not sure whether this will fix update detection when someone changed a file very deep in the folder structure of an external storage (from outside ownCloud). @icewind1991 will the "Always" mode rescan the whole external storage regardless of update detection ? |
Yes, i read everywhere that the SCAN function for SMB will not fix it indeed. its good to see you are working on this.. i think loads of people use ownCloud for SMB access.. atleast, thats what we like the most! |
8.1 will not fix this issue |
This is not a good news. When do you think this issue will be resolved ? Same issue in enterprise version, we can't use the system with SMB/CIFS and Owncloud Client. Strange problem like this in a cloud system. Thank you for your efforts. Regards, Clément. |
The main ticket about update detection #11797 has been scheduled for 8.2, so there is hope. |
We have a ticket about update detection -> close |
Expected behaviour
When you click in the OC root folder (/index.php/apps/files) the hasUpdated function is called for each mounted storage inside the root folder so that we can know that there are changes inside the mounted storage.
Actual behaviour
That function is not being called for the mounted storage (just for local storage) so other mounted storages don't report a change until we enter in them.
Steps to reproduce
Server configuration
Web server: apache
Database: sqlite3
PHP version: 5.3.10
ownCloud version: 5.0.11RC2
Client configuration
Browser: chromium and firefox
The text was updated successfully, but these errors were encountered: