Question about: Deleted items are no longer kept forever in the database, instead they are forgotten after six months.

4 Likes

Thank you! And my apologies for kicking off such a huge discussion. Syncthing is really cool.

3 Likes

I think I’ve found a bug.

For testing purposes, I modified the source code setting DBDeleteRetentionInterval to 1m and minDeleteRetention also to 1 * time.Minute.

I then did the following:

  1. There were two devices - A and B.
  2. I shared a folder with some files between A and B, and let it sync.
  3. I turned B off, then I deleted the files from A.
  4. After 1 minute, the deletions were “forgotten” (according to the log).
  5. I turned B on again, which connected to A, and then the files were deleted on it too.
  6. At this point, everything seemed fine.
  7. I then added the same files to B again, expecting them to be synced to A.
  8. However, the files are now stuck in sync as below:

Device A:

Device B:

I can do a proper bug report on GitHub with debug logs, etc. if necessary.

That indicates they weren’t forgotten. Something else is going on… But note also that I pointed out earlier that if the deleted files are the latest in the index, odd things will happen. You want at least some regular changes afterwards for things to make any kind of sense.

I’d retry this test, but use the actually permitted (now) 24h minimum window, default database cleanup interval, and make sure you have some changes after the deletes. Think of this on the (now) 15 month timescale, not the one minute timescale.

In either case, the interesting debug output is syncthing debug database-file from both sides for an affected file. (That’s also the way to confirm a delete is forgotten or not.)

Thank you mraneri, without your post I wouldn’t upgrade to 2.0 as for me db size isn’t an issue but having things show back up (because making a script that would do what that professional talks about would take days of working on it for a half hour in the evenings as these things are never provided and I would need to do a lot of learning) when a old device gets pulled out of a basement or brought back to civilization from the cabin would cause me a lot of work.

I do wish this defaulted to the option that caused me no problems (the old infinite) and then let those for whom this is a problem (who have professional programmers as seen above) change it to met their needs. It sounds like people for whom the scale of their Syncthing use caused the retention period being infinite to be an issue are also people for whom they have professionals and lots of knowledge. Those for whom the retention interval being short can cause problems are likely people running it at home and on a small scale and for whom configuration changes not in the GUI are difficult and making scripts are laborious.

To me this change highlights the difficulty of getting organizations to place burdens on those with many resources (who are often the ones directing change and funding efforts) and not on those with the least capabilities or resources.

I think I misunderstood the behavior with the deleted files. I think in the case of the database cleanup, it means deleted files won’t reappear on machines that didn’t have them. But it may mean files that were deleted on another machine may not be deleted on an old machine that was off for a while. There is more discussion in some other threads about it.

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