Skip to content

more clear exception if borg check does not help, fixes #2427#2432

Merged
enkore merged 1 commit intoborgbackup:masterfrom
ThomasWaldmann:beyond-repair
Apr 28, 2017
Merged

more clear exception if borg check does not help, fixes #2427#2432
enkore merged 1 commit intoborgbackup:masterfrom
ThomasWaldmann:beyond-repair

Conversation

@ThomasWaldmann
Copy link
Member

No description provided.

@ThomasWaldmann ThomasWaldmann self-assigned this Apr 20, 2017
@ThomasWaldmann ThomasWaldmann requested a review from enkore April 20, 2017 17:22
@ThomasWaldmann ThomasWaldmann added this to the 1.1.0b5 milestone Apr 20, 2017

class RepoBeyondRepair(ErrorWithTraceback):
"""Heavily damaged repository {} detected - maybe this is beyond being repairable."""

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, considering RPC, maybe adding a new exception is not the best way to deal with this.

i'll check if it can be done otherwise...

@ThomasWaldmann ThomasWaldmann changed the title don't raise CheckNeeded if check does not help, fixes #2427 more clear exception if borg check does not help, fixes #2427 Apr 20, 2017
@codecov-io
Copy link

codecov-io commented Apr 20, 2017

Codecov Report

Merging #2432 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2432      +/-   ##
==========================================
+ Coverage   82.95%   82.95%   +<.01%     
==========================================
  Files          20       20              
  Lines        7556     7557       +1     
  Branches     1288     1288              
==========================================
+ Hits         6268     6269       +1     
+ Misses        929      928       -1     
- Partials      359      360       +1
Impacted Files Coverage Δ
src/borg/repository.py 86.91% <100%> (+0.01%) ⬆️
src/borg/helpers.py 87.75% <0%> (-0.08%) ⬇️
src/borg/remote.py 76.93% <0%> (+0.2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc3bc1a...697942c. Read the comment docs.

@ThomasWaldmann
Copy link
Member Author

merge? we can do a better fix / refactor later to make the msg format more flexible.

if index_transaction_id is not None and segments_transaction_id is None:
raise self.CheckNeeded(self.path)
# we have a transaction id from the index, but we did not find *any*
# commit in the segment files (thus no segments transaction id).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC check actually covers this case by just appending a commit.

Copy link
Contributor

@enkore enkore Apr 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

         # self.index, self.segments, self.compact now reflect the state of the segment files up to <transaction_id>
         # We might need to add a commit tag if no committed segment is found
         if repair and segments_transaction_id is None:
             report_error('Adding commit tag to segment {}'.format(transaction_id))
             self.io.segment = transaction_id + 1
             self.io.write_commit()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, this is either not in 1.0.10 (see traceback in #2427) or done after the time when it already relies on the commit being there.

@enkore enkore merged commit c43cfb7 into borgbackup:master Apr 28, 2017
@ThomasWaldmann ThomasWaldmann deleted the beyond-repair branch April 28, 2017 17:13
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