Repository navigation
feat: Support gzip compression in server, Rust and Python clients - #693
sentry-junior[bot] wants to merge 9 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #693 +/- ##
==========================================
+ Coverage 91.90% 92.01% +0.11%
==========================================
Files 117 118 +1
Lines 24131 24321 +190
==========================================
+ Hits 22178 22380 +202
+ Misses 1953 1941 -12
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9f66941 to
74adec7
Compare
Adds Compression::Gzip to the shared types, so the server accepts and stores Content-Encoding: gzip. GCS (and S3-compatible) downloads now send Accept-Encoding: gzip to opt out of GCS decompressive transcoding, which would otherwise return decompressed bytes and ignore Range. The Rust client can compress, decompress, and size-bound gzip uploads. Refs FS-575
S3 and SeaweedFS serve objects as stored regardless of Accept-Encoding, so only the GCS backend needs to opt out of transcoding.
Uploads can be compressed with gzip on the fly or spooled for resumable uploads, precompressed gzip payloads are accepted, and gzip downloads are transparently decompressed, including multi-member payloads from multipart uploads. Unsupported algorithms are rejected up front, including on Usecase. Refs FS-575
- py-client: Replace the zstd-specific reader wrapper and the gzip reader with a single _CompressionReader driven by a compress/flush compressor. - py-client: Document why the gzip compressor sets wbits. - rust-client: Name the parts of the gzip size bound and drop its test.
d72e30a to
810ab32
Compare
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Python Client
Rust Client
Other
🤖 This preview updates automatically when you update the PR. |
…ression Co-Authored-By: Jan Michael Auer <[email protected]>
lcian
left a comment
There was a problem hiding this comment.
Looks good.
Junior, please answer my comment, and also check if we need to do anything in our Objectstore proxy endpoint in the sentry repo after this ships.
Leaving it to Jan to decide whether we want to feature flag this in the Rust client.
Adds gzip compression alongside Zstd in the server, Rust client, and Python client. Both clients now support compressed uploads and transparent download decompression. Zstd remains the default.
Accept-Encoding: gzipto prevent decompressive transcoding, which otherwise returns plaintext and ignoresRange. This preserves stored bytes for compressed downloads and range reads. The backend HTTP client already disables automatic decompression.compressBoundformula without the zlib wrapper, plus gzip framing. Precompressed uploads use their exact size.Usecase. Previously, an unknown usecase encoding caused Zstd compression with an incorrect encoding label.Compression::Gzipto the shared Rust enum breaks downstream exhaustive matches. Callers must handle the new variant or use a wildcard arm.Closes FS-575