Skip to content

lib/db: Don't get blocklists on drop and missing continue (ref #6457) - #6502

Merged
calmh merged 3 commits into
syncthing:masterfrom
imsodin:db/smallfixes
Apr 7, 2020
Merged

calmh merged 3 commits into
syncthing:masterfrom
imsodin:db/smallfixes

Conversation

@imsodin

@imsodin imsodin commented Apr 6, 2020

Copy link
Copy Markdown
Member

This fixes the panic in #6457, however not the underlying problem.
After quite extensive debugging with @eiszfuchs (thanks) the problem there became clear: While the check on upgrade makes sure there is a file info for ever global list entry, it does not unmarshal that file info. On dropping a file we do, and as part of unmarshalling we also look for the block list. That lookup then failed and caused the file not found error (which mislead me for a long time, as the file itself is there, just not the blocks).

Now we only get the truncated file info when dropping a file, which is enough and thus avoids the panic. The file info is still without a block list, so a problem will likely come up at some other point. And I have no clue what might cause it in the first place. In the debugged instance no RCs prior to 1.4.1-rc.3 were ever installed (and known bugs causing missing blocklists were only present in RCs).

The missing (now added) continue was luckily harmless: Without it the key was deleted twice, which has no consequence.

calmh
calmh previously approved these changes Apr 6, 2020
@imsodin

imsodin commented Apr 6, 2020

Copy link
Copy Markdown
Member Author

Wait merging please

calmh
calmh previously approved these changes Apr 6, 2020
@imsodin

imsodin commented Apr 6, 2020

Copy link
Copy Markdown
Member Author

Sorry for for dismissing again - went on a little hunt for other places were we needlessly get the full file info.

I'll probably in a further step remove getFileByKey, such that everyone needs to use getFileTrunc - however that involves a small (but potentially impactful) change to error handling so I'd rather put that into a separate PR.

@calmh
calmh merged commit df318ed into syncthing:master Apr 7, 2020
@calmh calmh added this to the v1.4.2 milestone Apr 7, 2020
@imsodin
imsodin deleted the db/smallfixes branch April 7, 2020 13:30
calmh added a commit that referenced this pull request Apr 8, 2020
* release:
  lib/db: Don't get blocklists on drop and missing continue (ref #6457) (#6502)
  Revert "cmd/syncthing: Do auto-upgrade before startup (fixes #6384) (#6385)"
  lib/ur: Correct freaky error handling (fixes #6499) (#6500)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Apr 8, 2021
@syncthing syncthing locked and limited conversation to collaborators Apr 8, 2021
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.

3 participants