Skip to content

feat(upload): Skip decompression - #6358

Draft
jjbayer wants to merge 4 commits into
masterfrom
feat/upload-no-decompress
Draft

feat(upload): Skip decompression#6358
jjbayer wants to merge 4 commits into
masterfrom
feat/upload-no-decompress

Conversation

@jjbayer

@jjbayer jjbayer commented Sep 8, 2026

Copy link
Copy Markdown
Member

So far, we've used tower's automatic decompression layer on all endpoints. This means that even for /upload requests, we decompress everything in every relay, and then re-compress before sending the data to the upstream or objectstore.

Not only is this a waste of CPU-cycles, it also causes a problem once objectstore supports resumable uploads, because the upload offset communicated by

Consequences:

  1. The Upload-Offset communicated to the client (i.e. SDK) will be in compressed bytes, not uncompressed bytes. This means that the SDK either needs to have the entire file in compressed form on disk, or needs to compress the entire file on-the-fly and discard bytes upto the offset if it needs to resume from an offset > 0.
  2. We can no longer count uncompressed bytes when emitting attachment placeholders -> Customers only pay for compressed bytes. This is only fair IMO.
  3. The /upload endpoint only supports zstandard compression or no compression, since that is what objectstore supports.

Check before merging:

  • File size in EventAttachment table will refer to compressed bytes. Does this break anything?

ref: INGEST-1162

jjbayer and others added 2 commits September 8, 2026 13:48
The `/upload` PATCH endpoint no longer decompresses request bodies. A
`zstd` body is forwarded or stored verbatim and the algorithm is recorded
on the object via objectstore's `precompressed` API. Any other content
encoding is rejected with 415.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

INGEST-1162

Comment thread relay-server/src/services/objectstore.rs
Comment thread relay-server/src/services/objectstore.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant