Skip to content

compression type bytes: include compression level / preset #6698

@ThomasWaldmann

Description

@ThomasWaldmann

when using borg recreate, there is the --recompress if-different option, that only recompresses if the data it is not already compressed with the desired algorithm.

this is useful to e.g. change from zlib to zstd, but not for changing zstd,1 to zstd,6. because we do not store the level yet, borg can only see "this is zstd compress", but has no idea about the level.

we store 2 bytes for the compression and currently only 1 of them is really used (only exception: the zlib type bytes hack we needed for the attic to borg transition). this hack is going away within PR #6663.

so we could store the level / preset into the 2nd byte to support borg recreate working efficiently when staying within the same algorithm and just changing the level.

for the import of compressed data (like with borg transfer), we do not know the compression level, so guess we need to reserve 0xff to mean unknown level) and patch that into the compression header at borg transfer time.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions