From b0e4f13fba9e415f6d70620ebb539b6c74f85abb Mon Sep 17 00:00:00 2001 From: Marian Beermann Date: Thu, 23 Feb 2017 00:34:40 +0100 Subject: [PATCH] set MAX_DATA_SIZE = 20971479 bytes in solid stone --- src/borg/constants.py | 4 +++- src/borg/repository.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/borg/constants.py b/src/borg/constants.py index 18e0bd5bf..610486d08 100644 --- a/src/borg/constants.py +++ b/src/borg/constants.py @@ -27,7 +27,9 @@ CACHE_TAG_CONTENTS = b'Signature: 8a477f597d28d172789f06886806bc55' # bytes. That's why it's 500 MiB instead of 512 MiB. DEFAULT_MAX_SEGMENT_SIZE = 500 * 1024 * 1024 -MAX_DATA_SIZE = 20 * 1024 * 1024 +# 20 MiB minus 41 bytes for a Repository header (because the "size" field in the Repository includes +# the header, and the total size was set to 20 MiB). +MAX_DATA_SIZE = 20971479 # A few hundred files per directory to go easy on filesystems which don't like too many files per dir (NTFS) DEFAULT_SEGMENTS_PER_DIR = 500 diff --git a/src/borg/repository.py b/src/borg/repository.py index 2999d8555..81935f4a9 100644 --- a/src/borg/repository.py +++ b/src/borg/repository.py @@ -1203,7 +1203,7 @@ class LoggedIO: return self.segment - 1 # close_segment() increments it -# MAX_OBJECT_SIZE = 20 MiB (MAX_DATA_SIZE) + 41 bytes for a Repository PUT header, which consists of +# MAX_OBJECT_SIZE = <20 MiB (MAX_DATA_SIZE) + 41 bytes for a Repository PUT header, which consists of # a 1 byte tag ID, 4 byte CRC, 4 byte size and 32 bytes for the ID. MAX_OBJECT_SIZE = MAX_DATA_SIZE + LoggedIO.put_header_fmt.size -assert MAX_OBJECT_SIZE == 20971561 +assert MAX_OBJECT_SIZE == 20971520 == 20 * 1024 * 1024