Bug or what I am doing wrong?

I have the latest Syncthing version installed in my:

Windows Laptop Debian Server

Between them, I have a shared folder named Test. The idea is send and receive files between them.

In Windows laptop, if I put a file inside Test folder and then I remove that file right away, Debian server is still synching the file… When it finished there is no file in the debian side.

I have the option Watch for changes enable and is still doing the same. The ideal scenario is, if I delete a file I put in the folder, Syncthing has to realize right away and avoid sync and fictitious file that was just removed.

Any ideas?

It’s not really clear what you’re trying to achieve here. Can you try to rephrase what your final goal is?

Just for the record, “send and receive” simply means continuous two-way synchronisation. In other words, the folder is supposed to be identical on both sides, and all changes (i.e. new file creations, modifications, deletions) are synced both ways.

If I understand you correctly, this is happening:

  1. file is created on Device A
  2. file is scanned on Device A
  3. meta data is send to Device B
  4. device B requests up to 16 MiB (default setting) worth of chunks from device A
  5. device A reads chunks from disk
  6. file is deleted on device A while up to 16MiB is being transferred to device B
  7. delete is picked up by watcher and process x seconds later
  8. in flight data is received by device B
  9. delete is propagated to device B
  10. file is deleted on device B after all in flight data is written to disk

As up to 16 MiB is already in flight, it will be processed by device B before the deletion is processed.

Thanks tomasz86 and wweich.

What I would like to do is: As soon a file/folder is created in Device A, it gets send to Device B in full, not in chunks. Also, if I remove a file from Device A, the Device B remove the file in full, not in chunks.

Where in the configuration can I remove the chunks configuration?

The file chunking process is a core part of Syncthing’s BEP so there’s no way to make it send an entire file at once.

But even if Syncthing had a toggle for chunk/full, as soon as a file is handed over to the host operating system to be sent across the network, it’ll be diced up into 1,500 byte chunks (the size of the default MTU for Ethernet) and reassembled chunk by chunk as they are received by host B.

When host B wants to delete a file, it tells the host operating system, which in turn tells the storage device (e.g., HDD, SSD). But files are rarely immediately deleted. Most filesystems only delete the directory entry, leaving the file itself in limbo with the data blocks it occupies marked as “available”. And when a file is actually deleted, the storage device will delete the file block by block (i.e., chunk by chunk). There really is no way to remove a file in full in a single drive operation.

Also, when a file is added/changed on host A, Syncthing is immediately notified by the host operating system. However, Syncthing waits 10 seconds (the default setting) before it triggers its scanner to begin the chunking and sync process to host B just in case there are several changes occurring close together. Bunching together multiple changes is more efficient than repeatedly starting new scans. So if you add and then delete a file in under 10 seconds on host A, Syncthing might only update the timestamp on the folder on host B with no file data being sent.

1 Like