1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 10:18:12 +00:00

use repository.scan() for dump-repo-objs to get on-disk order

it is also more efficient, avoids random access.
This commit is contained in:
Thomas Waldmann 2018-05-21 00:27:26 +02:00
parent c2ed0d9ee0
commit 2b7d65b024

View file

@ -1930,7 +1930,7 @@ def do_debug_dump_manifest(self, args, repository, manifest, key):
@with_repository(manifest=False) @with_repository(manifest=False)
def do_debug_dump_repo_objs(self, args, repository): def do_debug_dump_repo_objs(self, args, repository):
"""dump (decrypted, decompressed) repo objects""" """dump (decrypted, decompressed) repo objects, repo index MUST be current/correct"""
from .crypto.key import key_factory from .crypto.key import key_factory
# set up the key without depending on a manifest obj # set up the key without depending on a manifest obj
ids = repository.list(limit=1, marker=None) ids = repository.list(limit=1, marker=None)
@ -1940,7 +1940,7 @@ def do_debug_dump_repo_objs(self, args, repository):
marker = None marker = None
i = 0 i = 0
while True: while True:
result = repository.list(limit=LIST_SCAN_LIMIT, marker=marker) result = repository.scan(limit=LIST_SCAN_LIMIT, marker=marker) # must use on-disk order scanning here
if not result: if not result:
break break
marker = result[-1] marker = result[-1]