Skip to content

avoid orphan content chunks on BackupOSErrors - #7310

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:avoid-orphan-content-chunks2
Feb 3, 2023
Merged

avoid orphan content chunks on BackupOSErrors#7310
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:avoid-orphan-content-chunks2

Conversation

@ThomasWaldmann

@ThomasWaldmann ThomasWaldmann commented Feb 1, 2023

Copy link
Copy Markdown
Member

No description provided.

@ThomasWaldmann ThomasWaldmann added this to the 2.0.0b5 milestone Feb 1, 2023
@ThomasWaldmann

Copy link
Copy Markdown
Member Author

Note: this likely affects borg 1.x also. But due to the amount of changes, we better do not backport this (esp. considering that orphaned chunks are a harmless issue).

@codecov-commenter

codecov-commenter commented Feb 1, 2023

Copy link
Copy Markdown

Codecov Report

Merging #7310 (5de081c) into master (d0344cb) will increase coverage by 0.01%.
The diff coverage is 90.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #7310      +/-   ##
==========================================
+ Coverage   83.62%   83.64%   +0.01%     
==========================================
  Files          67       67              
  Lines       11670    11665       -5     
  Branches     2125     2121       -4     
==========================================
- Hits         9759     9757       -2     
  Misses       1341     1341              
+ Partials      570      567       -3     
Impacted Files Coverage Δ
src/borg/archiver/_common.py 89.72% <ø> (-0.06%) ⬇️
src/borg/archiver/create_cmd.py 78.48% <ø> (ø)
src/borg/archiver/tar_cmds.py 84.16% <ø> (ø)
src/borg/constants.py 100.00% <ø> (ø)
src/borg/upgrade.py 73.46% <ø> (ø)
src/borg/archiver/transfer_cmd.py 72.32% <33.33%> (-1.08%) ⬇️
src/borg/archive.py 84.27% <89.58%> (+0.19%) ⬆️
src/borg/archiver/debug_cmd.py 74.12% <100.00%> (ø)
src/borg/archiver/delete_cmd.py 71.26% <100.00%> (ø)
src/borg/archiver/diff_cmd.py 95.74% <100.00%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ThomasWaldmann
ThomasWaldmann force-pushed the avoid-orphan-content-chunks2 branch from 5de081c to 4640ca7 Compare February 1, 2023 12:06
@ThomasWaldmann

ThomasWaldmann commented Feb 2, 2023

Copy link
Copy Markdown
Member Author

@jdchristensen running your stress test script with code from this branch right now...

It worked. Didn't find any orphans nor did anything fail with rc != 0.

@jdchristensen

Copy link
Copy Markdown
Contributor

The version I last uploaded called the archives "::host*" because I was still using borg1 syntax, so it didn't prune correctly. Here is an updated version, which also includes other features. I ran this for 16 hours without generating any errors.

borg2-stress.txt

if we run into some issue reading an input file, e.g. an I/O error,
the BackupOSError exception raised due to that will skip the current
file and no archive item will be created for this file.

But we maybe have already added some of its content chunks to the repo,
we have either written them as new chunks or incref'd some identical chunk
in the repo.

Added an exception handler that decrefs (and deletes if refcount reaches 0)
these chunks again before re-raising the exception, so the repo is in a
consistent state again and we do not have orphaned content chunks in the repo.
@ThomasWaldmann
ThomasWaldmann force-pushed the avoid-orphan-content-chunks2 branch from 4640ca7 to ffe3231 Compare February 3, 2023 00:35
@ThomasWaldmann
ThomasWaldmann merged commit 63a0b3b into borgbackup:master Feb 3, 2023
@ThomasWaldmann
ThomasWaldmann deleted the avoid-orphan-content-chunks2 branch February 3, 2023 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants