Skip to content

backup writer: accept already compressed chunks - #525

Merged
petrutlucian94 merged 3 commits into
cloudbase:mainfrom
petrutlucian94:encoding
Oct 2, 2026
Merged

petrutlucian94 merged 3 commits into
cloudbase:mainfrom
petrutlucian94:encoding

Conversation

@petrutlucian94

Copy link
Copy Markdown
Member

Unlike VDDK, OpenVixDiskLib can skip decompressing chunks originating
from ESXi.

We can take advantage of this and forward the already compressed
FastLZ chunks to coriolis-writer.

To do so, we'll add the "encoding" and "uncompressed_length"
parameters to the "write" method of the backup writer interface.
The HTTP backup writer will skip the "compressor" queue when
receiving already chunks, submitting them directly to the "sender"
queue.

The caller may also use the "incompressible" encoding
as a hint that a given chunk cannot be compressed and that it should
be sent right away.

Other backup writers (ssh, file) will error out if an encoding
is specified.

Note that with FastLZ we also need to declare the uncompressed chunk
length. We went with a request header as opposed to a buffer prefix
in order to reduce the number of buffer copy operations.

While at it, we're including a coriolis-writer build that includes
FastLZ encoding support.

We'll add a minimal AGENTS.md file in order to guide AI tools.
@petrutlucian94
petrutlucian94 marked this pull request as ready for review September 30, 2026 08:33

@Dany9966 Dany9966 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from a couple of nits, LGTM

Comment thread AGENTS.md Outdated
Comment thread coriolis/providers/backup_writers.py
)
payload["uncompressed_size"] = uncompressed_size
self._sender_q.put(payload)
elif encoding == "incompressible":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the usual reasons for a chunk to be incompressible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeated sequences (e.g. zero blocks, text, etc) can easily be compressed. On the other hand, encrypted data usually cannot be compressed. Same applies to already compressed chunks (e.g. rotated log files).

High entropy leads to low compression rates.

Comment thread coriolis/providers/backup_writers.py Outdated
Comment thread coriolis/providers/backup_writers.py Outdated
Comment thread AGENTS.md Outdated
The AGENTS.md file can be condensed, preserving only the information
that is actually useful to AI agents.

The previous commit is kept intentionally as a reference.
Unlike VDDK, OpenVixDiskLib can skip decompressing chunks originating
from ESXi.

We can take advantage of this and forward the already compressed
FastLZ chunks to coriolis-writer.

To do so, we'll add the "encoding" and "uncompressed_length"
parameters to the "write" method of the backup writer interface.
The HTTP backup writer will skip the "compressor" queue when
receiving already chunks, submitting them directly to the "sender"
queue.

The caller may also use the "incompressible" encoding
as a hint that a given chunk cannot be compressed and that it should
be sent right away.

Other backup writers (ssh, file) will error out if an encoding
is specified.

Note that with FastLZ we also need to declare the uncompressed chunk
length. We went with a request header as opposed to a buffer prefix
in order to reduce the number of buffer copy operations.

While at it, we're including a coriolis-writer build that includes
FastLZ encoding support.
@petrutlucian94
petrutlucian94 merged commit fca89a1 into cloudbase:main Oct 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants