Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leftover/extra index volume after interrupted upload and more tests #5041

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Jojo-1000
Copy link
Contributor

Steps to reproduce

  • See IssueTests.Issue5023ReferencedFileMissing and RepairHandlerTests.RepairExtraIndexFiles

Current behavior

  • After interrupted dindex upload (but the upload finished), no index-block link is created
  • The next run uploads a new dindex file for the dblock
  • When repairing with an extra index file, the invalid ID -1 is inserted into the link table

New behavior

  • Index-block link is always created
  • The next run recognizes that the dindex file already exists and no extra is uploaded
  • When repairing with an extra index file, the correct ID is inserted into the link table

Impact

  • Order of operations in repair handler was changed to fix the ID bug, but wrapped in a transaction to ensure that no inconsistencies occur.
  • The index block link is created before the upload is known to be completed (instead of after the upload). It will be removed together with the RemoteVolume entry at the start of the next run.

The link was created before the volume was added to the database, resulting in ID -1.
See issue duplicati#5023.
The index-block link should be created before the upload is started, otherwise an interrupted backup could cause an index file without a link.
@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/how-to-fix-missing-volumes/17377/14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants