Out of sync files from old device


(Stratacast) #1

Hey folks! Old Syncthing user returning to an awesome project for a better quality sync protocol. I’m happy to see that there have been less sync conflicts for me than there were in the past. I do only have one issue though and I think I am part to blame for this one.

Context

I use Emacs for my work, which will create files starting with #. I didn’t do a proper save on those files so it kept the unsaved versions with the # in the name, then I went and reinstalled my OS.

What’s happening

I have 3 computers: a desktop, laptop, and server in the middle that’s on 24/7. 2 of those files prepended with a # are being shown as out of sync files on my desktop, but aren’t known by my other Syncthing clients. In addition, the files don’t exist on any copy of my data. They just show as being unsynced with the old Device ID that no longer exists.

What’s the best way to resolve this out of sync issue?


(Audrius Butkevicius) #2

There is no real way to solve it. If someone announced the files to the cluster and disappeared before anyone managed to download them, these files will be forever out of sync. Yet I’d expect them to be out of sync everywhere.

You can recreate the files manually somewhere and delete them, or try ignoring them.


(Simon) #3

Shouldn’t it go away if you remove the disappeared device?


(Audrius Butkevicius) #4

Why would it? It’s already merged to the global index with nobody being able to supply it.


(Simon) #5

The devices fileinfos are removed from the index upon its removal, which also removes it from the global list.


(Audrius Butkevicius) #6

I know it removes things for that particular device, I did not think it goes and unmerges the global version list if that file on this to be removed device is the latest version, and puts the version of some other device as latest (which I guess it has to check who from other devices has the second latest version?).

I though versions did not identify who added them, so I though it’s not even possible? What if B advertises a version from C, and A doesn’t even know C, how would A know to remove C’s version when removing B?

I guess you know better here, as I try to stay away from that region, but I thought devices that advertise content and then disappear will always be problematic.


(Jakob Borg) #7

Yeah, we do exactly this actually.

But there is some sort of index / out of sync issue. I just posted a bug on it.


(Simon) #8

I just checked and the global version list definitely gets updated on device removal. It doesn’t need to touch version vectors for that.

In your scenario, B just sends a fileinfo originally from C, but A doesn’t care about C, it just sets B’s fileinfo as the must current fileinfo. If B gets removed, that fileinfo gets removed, and if it happens to be the global one, the second fileinfo in the list now becomes global.


(Jakob Borg) #9

Much as I love both of those improvements, my gut feeling suspects something forgot to update the need index or the sequence index, somehow. Though I have no proof or smoking gun…


(Audrius Butkevicius) #11

Anyways, going back to the authors question, creating those files, letting them sync, and then deleting them should be sufficient to fix this.


(Stratacast) #12

Sure enough that did it, thanks! It was nice seeing some of the insides of how Syncthing figures this stuff out too on here