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

Implement streaming multipart zstd compression. #1413

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

obi1kenobi
Copy link
Collaborator

@obi1kenobi obi1kenobi commented Jan 14, 2025

Uses a hand-written streaming multipart writer that can wrap a zstd compressor, so that we try to not keep QueuedRun values in memory any longer than strictly necessary.

A "TODO" for tomorrow's revamp of the error types is to switch from unbounded to bounded channels and either use the QueueFull error variant or just block until the channel frees up. @agola11 do you have a preference one way or the other? This governs what happens in the rare instance if e.g. the server is much too slow at ingesting data and traces are piling up on the client. We can either drop data, or force the client to slow down, and this is a product-level decision.

It's a good idea to use bounded channels over unbounded ones, even if the bound is huge and shouldn't ever be hit. Bounded channels are both more efficient and can more gracefully handle excessive load. Unbounded channels grow until OOM and then kill the program, which is a worse experience.

@obi1kenobi
Copy link
Collaborator Author

Supersedes #1401, #1402, #1403.

@obi1kenobi obi1kenobi force-pushed the pg/streaming-multipart-zstd branch from 5f8ee11 to f3729d4 Compare January 14, 2025 22:38
@obi1kenobi obi1kenobi merged commit c813c65 into main Jan 15, 2025
16 checks passed
@obi1kenobi obi1kenobi deleted the pg/streaming-multipart-zstd branch January 15, 2025 16:14
obi1kenobi added a commit that referenced this pull request Jan 16, 2025
Builds upon #1413 and uses that functionality in the PyO3 crate.

This is a major breaking change in the API, so make it be part of a
v0.2.0-rc1 release.
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.

2 participants