-
Notifications
You must be signed in to change notification settings - Fork 476
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
chore(proxy): vendor a subset of rust-postgres #9930
chore(proxy): vendor a subset of rust-postgres #9930
Conversation
6310 tests run: 6020 passed, 0 failed, 290 skipped (full report)Flaky tests (3)Postgres 15
Postgres 14
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
4abd7b0 at 2024-11-28T19:39:23.469Z :recycle: |
Future planned changes:
|
This is a net reduction in code to maintain. Instead of maintaining the full fork of rust-postgres
We only need to maintain a relatively simple patch set of 1600 lines and this new set of code
8260 + 1600 << 19711 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Nice work!
I didn't review every line, not even every file. We will need to rely on testing here.
You added the rustls module to proxy proper so the new crates are and stay crypto provider agnostic?
There wasn't much reason to it for now. Just needed to get it to compile. I could have put it in it's own crate or even into tokio-postgres directly. I didn't think much about it at the time. We can shuffle stuff around later |
Our rust-postgres fork is getting messy. Mostly because proxy wants more control over the raw protocol than tokio-postgres provides. As such, it's diverging more and more. Storage and compute also make use of rust-postgres, but in more normal usage, thus they don't need our crazy changes. Idea: * proxy maintains their subset * other teams use a minimal patch set against upstream rust-postgres Reviewing this code will be difficult. To implement it, I 1. Copied tokio-postgres, postgres-protocol and postgres-types from https://github.com/neondatabase/rust-postgres/tree/00940fcdb57a8e99e805297b75839e7c4c7b1796 2. Updated their package names with the `2` suffix to make them compile in the workspace. 3. Updated proxy to use those packages 4. Copied in the code from tokio-postgres-rustls 0.13 (with some patches applied jbg/tokio-postgres-rustls#32 jbg/tokio-postgres-rustls#33) 5. Removed as much dead code as I could find in the vendored libraries 6. Updated the tokio-postgres-rustls code to use our existing channel binding implementation
Our rust-postgres fork is getting messy. Mostly because proxy wants more control over the raw protocol than tokio-postgres provides. As such, it's diverging more and more. Storage and compute also make use of rust-postgres, but in more normal usage, thus they don't need our crazy changes.
Idea:
Reviewing this code will be difficult. To implement it, I
2
suffix to make them compile in the workspace.