-
-
Notifications
You must be signed in to change notification settings - Fork 762
Add repair count to borg check --repair output #8260
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1870,9 +1870,14 @@ def check( | |
match=match, first=first, last=last, sort_by=sort_by, older=older, oldest=oldest, newer=newer, newest=newest | ||
) | ||
self.orphan_chunks_check() | ||
self.repair_count = 0 | ||
self.orphan_chunks_check() | ||
self.finish() | ||
if self.error_found: | ||
logger.error("Archive consistency check complete, problems found.") | ||
if self.repair_count > 0: | ||
logger.error(f"Archive consistency check complete, problems found and {self.repair_count} problem(s) repaired.") | ||
else: | ||
logger.error("Archive consistency check complete, problems found.") | ||
else: | ||
logger.info("Archive consistency check complete, no problems found.") | ||
return self.repair or not self.error_found | ||
|
@@ -2338,7 +2343,9 @@ def orphan_chunks_check(self): | |
) | ||
for id_ in unused: | ||
self.repository.delete(id_) | ||
self.repair_count += 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guess it is least important to count the fixed orphaned objects - while they should not occur in the ideal case, there can be conditions producing them. But, orphans (chunks that are not referenced by any archive) are only a cosmetic issue and we could also just silently remove them (that's why the log message is on INFO level, not WARNING or ERROR). It would be more important to count the severe "repaired" issues, e.g. if a referenced chunk is missing from the repo and was replaced by an all-zero replacement chunk. That's data loss and the repair is only bringing back consistency, but it's not bringing back the data. If such a lost chunk reappears later, borg check can also heal it, that's a real repair then. |
||
logger.info("Finished deleting orphaned/superseded objects.") | ||
|
||
else: | ||
logger.info("Orphaned objects check skipped (needs all archives checked).") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you accidentally duplicated the call to orphan_chunks_check.