fix chunk refcounts considering part files

This commit is contained in:
Thomas Waldmann 2016-07-28 17:55:40 +02:00
parent 04ad1d1b0b
commit 999f0ae187
1 changed files with 12 additions and 9 deletions

View File

@ -729,9 +729,6 @@ Number of files: {0.stats.nfiles}'''.format(
number += 1
self.add_item(item, show_progress=False)
self.write_checkpoint()
# we have saved the part file, but we will reference the same chunks also from the final, complete file:
for chunk in item.chunks:
cache.chunk_incref(chunk.id, stats)
return length, number
item.chunks = []
@ -745,12 +742,18 @@ Number of files: {0.stats.nfiles}'''.format(
from_chunk, part_number = write_part(item, from_chunk, part_number)
self.last_checkpoint = time.time()
else:
if part_number > 1 and item.chunks[from_chunk:]:
# if we already have created a part item inside this file, we want to put the final
# chunks (if any) into a part item also (so all parts can be concatenated to get
# the complete file):
from_chunk, part_number = write_part(item, from_chunk, part_number)
self.last_checkpoint = time.time()
if part_number > 1:
if item.chunks[from_chunk:]:
# if we already have created a part item inside this file, we want to put the final
# chunks (if any) into a part item also (so all parts can be concatenated to get
# the complete file):
from_chunk, part_number = write_part(item, from_chunk, part_number)
self.last_checkpoint = time.time()
# if we created part files, we have referenced all chunks from the part files,
# but we also will reference the same chunks also from the final, complete file:
for chunk in item.chunks:
cache.chunk_incref(chunk.id, stats)
def process_stdin(self, path, cache):
uid, gid = 0, 0