Stalled synchronisation due to reusing blocks from busy local storage

I have encountered a quite uncommon situation today.

In short, the machine has two storage devices. There are Syncthing folders located on both of them. When trying to sync a new folder to the first one, Syncthing was trying to reuse blocks from the folders located on the second one.

The problem is that the second device was busy with 100% I/O doing other things, which resulted in a complete stall of the synchronisation. Syncthing kept waiting to copy the files from there instead of downloading them from the network, which would have been much faster. I even checked the model debugging to verify that the files were actually being copied, and indeed the transfer was going on, but extremely slowly.

The question is - is it possible to prevent or work around this kind of a situation? Normally, I like the fact Syncthing reuses blocks, but here, the network transfer was at least 2-3MB/s, while the local copy was going on with a speed of 1B/s.

No, there is nothing you can do here really.

It would be nice to either have an option either to disable the default behaviour, or maybe just be able to have Syncthing simply use the faster option. Basically, if network transfer speed > local transfer speed, then use the faster one of the two.

At the moment, Syncthing always prioritises local blocks, right? Normally this makes sense, but there are probably some corner cases, like this one, or maybe a situation, where someone has other folders located on a network drive or something, where accessing the files can be very slow, etc.

Do we really want to optimize for such a corner case?

No.

It would be useful to at least have some kind of a workaround. Right now, Syncthing seems to assume that local block reuse is always better/faster, which does not need to be necessarily true.

I have skimmed through the code in folder_recvenc.go and sharedpullerstate.go, but I have been unable to find an easy way to simply disable block reuse altogether (or at least I’m not seeing anything obvious with my limited coding skills).

Just for the record, it took around 3 hours to transfer/copy a 200 MB file yesterday, because of the busy storage. The same file existed in a different folder, so Syncthing kept trying to reuse blocks from there instead of downloading it from the remote device.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.