mirror of https://github.com/borgbackup/borg.git
cache sync: fetch_missing_csize don't check ids against empty idx
This is always the case if self.do_cache is False.
This commit is contained in:
parent
fc7c560345
commit
3c8257432a
|
@ -644,6 +644,7 @@ class LocalCache(CacheStatsMixin):
|
||||||
|
|
||||||
all_missing_ids = chunk_idx.zero_csize_ids()
|
all_missing_ids = chunk_idx.zero_csize_ids()
|
||||||
fetch_ids = []
|
fetch_ids = []
|
||||||
|
if len(chunks_fetched_size_index):
|
||||||
for id_ in all_missing_ids:
|
for id_ in all_missing_ids:
|
||||||
already_fetched_entry = chunks_fetched_size_index.get(id_)
|
already_fetched_entry = chunks_fetched_size_index.get(id_)
|
||||||
if already_fetched_entry:
|
if already_fetched_entry:
|
||||||
|
@ -652,6 +653,8 @@ class LocalCache(CacheStatsMixin):
|
||||||
chunk_idx[id_] = entry
|
chunk_idx[id_] = entry
|
||||||
else:
|
else:
|
||||||
fetch_ids.append(id_)
|
fetch_ids.append(id_)
|
||||||
|
else:
|
||||||
|
fetch_ids = all_missing_ids
|
||||||
|
|
||||||
for id_, data in zip(fetch_ids, decrypted_repository.repository.get_many(fetch_ids)):
|
for id_, data in zip(fetch_ids, decrypted_repository.repository.get_many(fetch_ids)):
|
||||||
entry = chunk_idx[id_]._replace(csize=len(data))
|
entry = chunk_idx[id_]._replace(csize=len(data))
|
||||||
|
|
|
@ -1041,6 +1041,9 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
||||||
create_stats = create_json['cache']['stats']
|
create_stats = create_json['cache']['stats']
|
||||||
info_stats = info_json['cache']['stats']
|
info_stats = info_json['cache']['stats']
|
||||||
assert create_stats == info_stats
|
assert create_stats == info_stats
|
||||||
|
self.cmd('delete', '--cache-only', self.repository_location)
|
||||||
|
self.cmd('create', '--no-cache-sync', self.repository_location + '::test2', 'input')
|
||||||
|
self.cmd('info', self.repository_location)
|
||||||
self.cmd('check', self.repository_location)
|
self.cmd('check', self.repository_location)
|
||||||
|
|
||||||
def test_extract_pattern_opt(self):
|
def test_extract_pattern_opt(self):
|
||||||
|
|
Loading…
Reference in New Issue