diff --git a/src/borg/archive.py b/src/borg/archive.py index 4cf937bf7..31b1f0575 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -1877,7 +1877,6 @@ def check( self.rebuild_refcounts( match=match, first=first, last=last, sort_by=sort_by, older=older, oldest=oldest, newer=newer, newest=newest ) - self.orphan_chunks_check() self.finish() if self.error_found: logger.error("Archive consistency check complete, problems found.") @@ -2346,25 +2345,6 @@ def valid_item(obj): self.manifest.archives[info.name] = (new_archive_id, info.ts) pi.finish() - def orphan_chunks_check(self): - if self.check_all: - unused = {id_ for id_, entry in self.chunks.iteritems() if entry.refcount == 0} - orphaned = unused - self.possibly_superseded - if orphaned: - 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.") - # To support working with AdHocCache or AdHocWithFilesCache, 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)) - ) - for id_ in unused: - self.repository.delete(id_) - logger.info("Finished deleting orphaned/superseded objects.") - else: - logger.info("Orphaned objects check skipped (needs all archives checked).") - def finish(self): if self.repair: logger.info("Writing Manifest.") diff --git a/src/borg/testsuite/archiver/check_cmd.py b/src/borg/testsuite/archiver/check_cmd.py index d68998820..14683682c 100644 --- a/src/borg/testsuite/archiver/check_cmd.py +++ b/src/borg/testsuite/archiver/check_cmd.py @@ -355,12 +355,7 @@ def test_extra_chunks(archivers, request): chunk = fchunk(b"xxxx") repository.put(b"01234567890123456789012345678901", chunk) repository.commit(compact=False) - 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) - 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) + cmd(archiver, "check", "-v", exit_code=0) # check does not deal with orphans anymore @pytest.mark.parametrize("init_args", [["--encryption=repokey-aes-ocb"], ["--encryption", "none"]])