Documentation on synching algorithm (for updates)

  • Environment:
  • Server: Professional Edition v. 7.1.6
  • Client: SeaDrive v. 2.0.13
  • Platform: Mostly Windows, but also Mac and Linux

Question 1: How much the differences in the clocks of the computers, either small (seconds/minutes) or large (hours/days) can affect the SeaFile/SeaDrive clients operations and possibly generate incorrect syncs?

Question 2: What is the general mechanism used to synchronize the files/folders in the libraries with reference to timings?

In other words, is it monitoring the filesystem every X seconds, is it using system calls for file changes, how is priority of synching performed? We were looking for documentation but found none.

1.) The client uses the system time. As a consequence, even a small discrepancy in the system time can affect the reliability of the sync process. (As far as I know, this is not a problem exclusive to Seafile, but other sync & share tools have the same dependency.)

If a clock is off (or set to the wrong time zone), the results can be terribly wrong. But they are only wrong from you perspective. From the perspective of the sync algorithm, the results are correct.

As a consequence, it is highly recommended to have system clocks be synced automatically.

2.) I don’t have a detailed documentation of the sync algorithm. So here is what I know:

  • Seafile uses subsystems of the operating systems to monitor changes in the file system. In the case of Linux, this is inotify. SeaDrive 2.0 for Windows uses the Cloud Files API. This way, Seafile circumvents the need to poll directories for file updates. As you can imagine, the later would be massively resource intensive on systems with a lot of files that Seafile needs to check. If you want to enable polling, you can: right-click on a library and choose “Set sync intervall”.
  • This presentation, however, provides a good overview.
  • Last but not least, the truth lies in the code.
1 Like