Skip to content

lib/db, lib/model: Allow needing invalid files (fixes #7474) - #7476

Merged
calmh merged 1 commit into
syncthing:mainfrom
imsodin:lib/need-invalid
Mar 15, 2021
Merged

calmh merged 1 commit into
syncthing:mainfrom
imsodin:lib/need-invalid

Conversation

@imsodin

@imsodin imsodin commented Mar 14, 2021

Copy link
Copy Markdown
Member

Purpose

Scenario (#7474 (comment)):

The reason is that we have an "efficiency" measure: We do not pull items that are not present at all locally and globally invalid or deleted. B sees valid items from A, thus their global is valid. C only sees invalid items from B, thus their global is invalid and they don't pull. B doesn't know about C's global, thus shows C as out of sync. The fix here is to always pull invalid files ("pull" as in create a local invalid entry too).

I adjusted Need to consider invalid files needed, and added a shortcut to the puller to send invalid files directly to the db. If at some point we do create a local file, that "trumps" the invalid file as usual (bumps the version of the invalid file, uninvalidates it, ...).

I also added a db migration to trigger a repair, otherwise the changes don't take effect.

Testing

Unit test checking that we do pull and send back an invalid file info.
Needed to add some machinery to the fake connection to correctly send invalid files.

@calmh
calmh merged commit 273ee09 into syncthing:main Mar 15, 2021
@tomasz1986

tomasz1986 commented Mar 15, 2021 •

Copy link
Copy Markdown
Member

I also added a db migration to trigger a repair, otherwise the changes don't take effect.

I have tested the commit, but I did have to reset the databases in order for the errors to go away. Was is supposed to fix itself after replacing the binary?

@imsodin
imsodin deleted the lib/need-invalid branch March 15, 2021 10:25
@imsodin

imsodin commented Mar 15, 2021

Copy link
Copy Markdown
Member Author

Yes, should have fixed itself. On which device did you test it? You would have to do it on the device shown as out of sync, i.e. device C in your scenario in #7474.

@tomasz1986

Copy link
Copy Markdown
Member

I had replaced the binary on all three. However, I have also now tried to reproduce the behaviour again with a completely new folder, and it did fix itself, so I would call this solved 🙂.

@st-release st-release added this to the v1.15.0 milestone Mar 17, 2021
imsodin added a commit to imsodin/syncthing that referenced this pull request Apr 23, 2021
calmh pushed a commit to calmh/syncthing that referenced this pull request Apr 26, 2021
calmh added a commit that referenced this pull request Apr 27, 2021
* release:
  lib/model: Handle invalid needed items on send-only (ref #7476) (#7596)
  gui: Handle empty path in validation (ref #7379) (#7595)
  cmd/syncthing: Don't fail early on api setup error (fixes 7558) (#7591)
imsodin added a commit to imsodin/syncthing that referenced this pull request Apr 29, 2021
imsodin added a commit to imsodin/syncthing that referenced this pull request Apr 29, 2021
imsodin added a commit to imsodin/syncthing that referenced this pull request Apr 29, 2021
imsodin added a commit to imsodin/syncthing that referenced this pull request Apr 29, 2021
greatroar pushed a commit to greatroar/syncthing that referenced this pull request May 8, 2021
tomasz1986 pushed a commit to tomasz1986/syncthing that referenced this pull request May 21, 2021
tomasz1986 pushed a commit to tomasz1986/syncthing that referenced this pull request Aug 18, 2021
@calmh calmh added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Aug 11, 2022
@syncthing syncthing locked and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants