Is NTP time required for Syncthing?

I’ve been reading on how actual sync process works: https://docs.syncthing.net/users/syncing.html

And there are mentions that modification time of the files is a factor for synchronization and conflict resolution. But i didn’t found a mention that i should strictly sync my time with reliable NTP server.

Do i need to do that? Or does syncthing use some kind of relative timing (or even vector clock) to achieve reliable sychronization?

Lets say i bidirectionaly sync server with laptop. Server is always online and has reasonable NTP setup. But the laptop i sometimes take to my cabin in the woods to work during weekends, but there is no internet (and no NTP). And for some reason my time goes month back in time without me noticing. And i do lot of work during that weekend, but modification times of files are suddenly month older than the copy that i have on server. I go back to the city and resync with the server only to find that my recent work was overwritten by the old files from server.

Is this something that i should be afraid of? Or does the syncthing knows IT HAS SEEN THE FILES ON SERVER BEFORE i did the modifications localy, which means my copy has to be more recent despite its modification date seems to be in the past.


Bonus use case: I sync my phone to my laptop. But i go to some developing country with crazy mobile network. Laptop uses my favourite NTP server, but my phone is setup to sync time with local mobile network (so i don’t have to care about timezone, whatever…). But since it’s developing country, they don’t care much about maintenance and their time is completely off for some negligence maybe even combined with religious reasons. This actualy happened to me this summer. Will this affect synchronization?

1 Like

No, not really. Modtime is indeed a factor in conflict resolution, because we need to use something to decide between concurrent changes, but it’s not a factor in normal synchronization.

So can i trust syncthing not to loose my data when clocks on my devices are completely random jumping back and forth doing all sorts of crazy stuff?

If or when Syncthing eats your data it won’t be due to clock discrepancies, no.

That is really nice. Thank you for the answer.