feat(syncengine): fail and restart the sync if discovery is suspicious - #9572
Conversation
mgallien
left a comment
There was a problem hiding this comment.
do we want to enable this always or depending on a dedicated setting (or platform discovery) ?
mgallien
left a comment
There was a problem hiding this comment.
windows automated tests for VFS are broken
|
/backport! to stable-4.0 |
1569899 to
ef960ae
Compare
ef960ae to
5add2e5
Compare
f155d6f to
a1e8b9b
Compare
otherwise the debug logs will never be enabled by the "nextcloud.*.debug=true" rule Signed-off-by: Jyrki Gadinger <[email protected]>
Especially with many file changes incoming, by the time the sync actually starts the local discovery list might not have caught all changes yet. Signed-off-by: Jyrki Gadinger <[email protected]>
Apparently there was a change in Windows which causes the low-level APIs for iterating over directories to not return all contents when iterating over a just-changed folder that has cfapi enabled. The file system watcher might have already caught the changes, but it could still be that during discovery those APIs are returning the wrong state. This is especially awful when folders are moved, as the rename detection will not work. In this specific case what happens is the following: - First sync run: during discovery only the origin folder is discovered as missing. Propagation: remote DELETE of the origin folder, and the sync DB is cleaned from all files inside that directory. - Second sync run: the sync engine detects the target folder, but the placeholder files inside it are unknown as they had been removed from the sync DB. As the folder structure is present locally, the folder tree will be propagated remotely, and all local virtual placeholder files are removed from the file system. Therefore, to be on the safe side: fail the sync after discovery if there was at least one deletion once. A follow-up sync attempt is assumed to then have the correct view of the file system again. See also: #8983 Signed-off-by: Jyrki Gadinger <[email protected]>
add extra sync runs as needed Signed-off-by: Matthieu Gallien <[email protected]> Signed-off-by: Jyrki Gadinger <[email protected]>
Signed-off-by: Jyrki Gadinger <[email protected]>
a1e8b9b to
2b0deab
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-9572.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
|
/backport to stable-33.0 |




Apparently there was a change in Windows which causes the low-level APIs for iterating over directories to not return all contents when iterating over a just-changed folder that has cfapi enabled.
The file system watcher might have already caught the changes, but it could still be that during discovery those APIs are returning the wrong state. This is especially awful when folders are moved, as the rename detection will not work. In this specific case what happens is the following:
Therefore, to be on the safe side: fail the sync after discovery if there was at least one deletion once. A follow-up sync attempt is assumed to then have the correct view of the file system again.
See also: #8983