diff --git a/src/borg/archive.py b/src/borg/archive.py index 8da51b22d..13cac5fc5 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -2331,10 +2331,10 @@ class ArchiveChecker: unused = {id_ for id_, entry in self.chunks.iteritems() if entry.refcount == 0} orphaned = unused - self.possibly_superseded if orphaned: - logger.error(f"{len(orphaned)} orphaned objects found!") + logger.info(f"{len(orphaned)} orphaned (unused) objects found.") for chunk_id in orphaned: logger.debug(f"chunk {bin_to_hex(chunk_id)} is orphaned.") - self.error_found = True + # To support working with AdHocCache or NewCache, we do not set self.error_found = True. if self.repair and unused: logger.info( "Deleting %d orphaned and %d superseded objects..." % (len(orphaned), len(self.possibly_superseded)) diff --git a/src/borg/testsuite/archiver/check_cmd.py b/src/borg/testsuite/archiver/check_cmd.py index cf4c6baf2..16b768073 100644 --- a/src/borg/testsuite/archiver/check_cmd.py +++ b/src/borg/testsuite/archiver/check_cmd.py @@ -338,10 +338,11 @@ def test_extra_chunks(archivers, request): with Repository(archiver.repository_location, exclusive=True) as repository: repository.put(b"01234567890123456789012345678901", b"xxxx") repository.commit(compact=False) - cmd(archiver, "check", exit_code=1) - cmd(archiver, "check", exit_code=1) + output = cmd(archiver, "check", "-v", exit_code=0) # orphans are not considered warnings anymore + assert "1 orphaned (unused) objects found." in output cmd(archiver, "check", "--repair", exit_code=0) - cmd(archiver, "check", exit_code=0) + output = cmd(archiver, "check", "-v", exit_code=0) + assert "orphaned (unused) objects found." not in output cmd(archiver, "extract", "archive1", "--dry-run", exit_code=0)