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

Do not assert on diff if hard link sources are not found due to exclusions #8344

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

cr1901
Copy link
Contributor

@cr1901 cr1901 commented Aug 26, 2024

Per IRC, borg diff will assert if a multiply-linked file is selected for compare, but its hard link source was not selected for compare. Print a warning and allow the diff to continue.

Example failure:

william@xubuntu-dtrain:/shares/wjones/work/browser-hist$ borg diff --content-only ::WD3200BEVT-userprofile-2021-10-17-120019 WD3200BEVT-userprofile-2021-10-24-120006 --pattern="+ pf:" --pattern="+ pp:Downloads" --pattern="! **/" > /dev/null
Local Exception
Traceback (most recent call last):
  File "/home/william/Projects/borg/borg/src/borg/archiver.py", line 5412, in main
    exit_code = archiver.run(args)
  File "/home/william/Projects/borg/borg/src/borg/archiver.py", line 5330, in run
    rc = func(args)
  File "/home/william/Projects/borg/borg/src/borg/archiver.py", line 191, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/home/william/Projects/borg/borg/src/borg/archiver.py", line 206, in wrapper
    return method(self, args, repository=repository, manifest=manifest, key=key, archive=archive, **kwargs)
  File "/home/william/Projects/borg/borg/src/borg/archiver.py", line 1172, in do_diff
    for path, diff in diffs:
  File "/home/william/Projects/borg/borg/src/borg/archiver.py", line 1167, in <genexpr>
    diffs = ((path, diff.changes()) for path, diff in diffs if not diff.equal)
  File "/home/william/Projects/borg/borg/src/borg/archive.py", line 1120, in compare_archives_iter
    assert hardlink_master_seen(item1)
AssertionError

Platform: Linux xubuntu-dtrain 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64
Linux: Unknown Linux
Borg: 1.4.1.dev26+gad502848  Python: CPython 3.10.12 msgpack: 1.0.8 fuse: pyfuse3 3.2.0 [pyfuse3,llfuse]
PID: 3004014  CWD: /shares/wjones/work/browser-hist
sys.argv: ['/home/william/.local/bin/borg', 'diff', '--content-only', '::WD3200BEVT-userprofile-2021-10-17-120019', 'WD3200BEVT-userprofile-2021-10-24-120006', '--pattern=+ pf:', '--pattern=+ pp:Downloads', '--pattern=! **/']
SSH_ORIGINAL_COMMAND: None

src/borg/archive.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.51%. Comparing base (938e144) to head (2720331).
Report is 14 commits behind head on 1.4-maint.

Files with missing lines Patch % Lines
src/borg/archive.py 66.66% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           1.4-maint    #8344      +/-   ##
=============================================
- Coverage      82.73%   82.51%   -0.23%     
=============================================
  Files             38       38              
  Lines          11049    11081      +32     
  Branches        2123     2133      +10     
=============================================
+ Hits            9141     9143       +2     
- Misses          1344     1369      +25     
- Partials         564      569       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
Copy link
Member

@cr1901 Is this still on your radar?

@cr1901
Copy link
Contributor Author

cr1901 commented Sep 28, 2024

Yes, it's still on my radar. Though, I've been working on trying to finish several things this past month, and am coming around to the PRs I owe you.

@cr1901
Copy link
Contributor Author

cr1901 commented Oct 2, 2024

@ThomasWaldmann Addressed your feedback and added a test. I am marking as ready for review.

@cr1901 cr1901 marked this pull request as ready for review October 2, 2024 04:11
@ThomasWaldmann ThomasWaldmann merged commit d94b954 into borgbackup:1.4-maint Oct 6, 2024
9 of 11 checks passed
@ThomasWaldmann
Copy link
Member

Thanks! master branch needs checking, the hardlinks stuff is different (better) there.

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

Successfully merging this pull request may close these issues.

3 participants