Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reading and writing compressed blobs #8106

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

arpad-m
Copy link
Member

@arpad-m arpad-m commented Jun 19, 2024

Add support for reading and writing zstd-compressed blobs for use in image layer generation, but maybe one day useful also for delta layers. The reading of them is unconditional while the writing is controlled by the image_compression config variable allowing for experiments.

For the on-disk format, we re-use some of the bitpatterns we currently keep reserved for blobs larger than 256 MiB. This assumes that we have never ever written any such large blobs to image layers.

After the preparation in #7852, we now are unable to read blobs with a size larger than 256 MiB (or write them).

TODO:

  • Maybe introduce a new version so that we give better errors should we encounter legacy image layers with such large blobs. This is to insure us in the case the assumption above is wrong, so there is > 256MiB large images. eventually chosen against as image layers and delta layers have different ways of storing the version number.

A non-goal of this PR is to come up with good heuristics of when to compress a bitpattern. This is left for future work.

Parts of the PR were inspired by #7091.

cc #7879

Part of #5431

@arpad-m arpad-m requested a review from VladLazar June 19, 2024 00:30
Copy link

github-actions bot commented Jun 19, 2024

No tests were run or test report is not available

Test coverage report is not available

The comment gets automatically updated with the latest test results
5fc3b3c at 2024-06-21T15:07:46.442Z :recycle:

pageserver/src/tenant/blob_io.rs Outdated Show resolved Hide resolved
pageserver/src/tenant/blob_io.rs Show resolved Hide resolved
pageserver/src/tenant/blob_io.rs Show resolved Hide resolved
@arpad-m arpad-m marked this pull request as ready for review June 20, 2024 22:29
@arpad-m arpad-m requested a review from a team as a code owner June 20, 2024 22:29
@arpad-m arpad-m requested review from jcsp and VladLazar June 20, 2024 22:29
Copy link
Contributor

@VladLazar VladLazar left a comment

Choose a reason for hiding this comment

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

Test needs updating, but otherwise looks good to me. It would have been interesting to make the de-compression lazy (i.e. decompress right before walredo).

pageserver/src/tenant/blob_io.rs Show resolved Hide resolved
pageserver/src/tenant/blob_io.rs Outdated Show resolved Hide resolved
@arpad-m arpad-m requested a review from VladLazar June 21, 2024 15:06
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.

None yet

3 participants