I’m running Syncthing v2.1.7 between two Synology NAS devices. On the receiving NAS, a DS923+, Synology Cloud Sync forwards changes to Sync.com through WebDAV.
A rename received through Syncthing causes Cloud Sync to delete the existing cloud file and upload its contents again. This is costly for large videos.
Using one disposable 102 MB file, we established:
A direct rename on the receiving NAS, using File Station or Terminal, produces “Rename remote file” in Cloud Sync.
A Syncthing-delivered rename produces “Delete remote file” followed by “Upload.”
The local inode stayed unchanged across the Syncthing rename.
Two rapid Terminal renames through an intermediate filename reproduce the failure without Syncthing performing the operation.
Both an ordinary intermediate filename and a .syncthing.…tmp filename trigger it.
Allowing temporary files in Cloud Sync’s filters did not fix it.
Pausing Cloud Sync during the Syncthing rename and resuming afterward did not fix it.
The v2.1.7 source appears to move the existing file to a temporary name before moving it to the final name.
Is there a supported way to apply a recognized rename directly to its final filename, or would that require a code change? Is the intermediate step necessary even when file versioning is disabled and the destination does not exist?
I understand this may be a Cloud Sync limitation. I’m asking whether Syncthing offers a compatible rename path or whether there is an existing discussion about this interaction.
Basically there is no rename detection. Syncthing sees it as one file is deleted and another file is added.
In some cases Syncthing doesn’t require a retransfer because in certain circumstances it can copy from the deleted file before it’s deleted. In other cases the file (or parts of the file) are retransmitted.
either way syncthing never “renames” a file due to a change on a remote node.
No it totally does, if it can see the delete + addition both at the time of syncing. It is however dependent on circumstances, and works better on some systems than others. Directory renames are fast on Unixes (a single operation) and likely to get detected as renames, on Windows its individual renames of all the child files and much less likely to be seen as a coherent operation when scanned at any point in time during the rename.
Never experienced this. I rename from the windows side sometimes and the Linux side sometimes. And the renames always cause another copy to be made and the original to be deleted or versioned.
Your scenario where a file is copied and then deleted is a subset of the “copy_elsewhere” bar – a subset because actual file copies also go into that category, plus any case where a block happened to already exist in another file. The “renamed” bar is where a file in its entirety was moved from one name to another as a shortcut for copy+delete. Obviously the bulk of data changes over time are neither copies nor renames but updates to existing or new files.
(The “reused” bar, blocks reused from a temp file on sync retry, is somewhat misleading here because it’s effectively a percentage of a different whole than the others, statistical difficulties.)
Maybe it works for small files that rescan within the 10 second waiting period for detected deletes.
But if the only way this works is the files have to be small enough that the rescan that happens after renaming a directory takes less than 10 seconds, then this is not really the target application. LOL
it’s like you solved the re-copy problem when recopying isn’t a big deal. But when you really need an atomic rename after changing the name of a large director, it doesn’t work.
Anyway it’s been useless for me. And a title disappointing that it seems there’s little acknowledgement that it doesn’t work for many use cases.