build: link storage controller with system libpq #10258
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We see occasional storage controller segfaults (https://github.com/neondatabase/cloud/issues/21010), which are correlated with database connection errors, and it is known that using statically linked openssl from multi-threaded programs is risky (https://github.com/neondatabase/cloud/issues/16155)
Summary of changes
CARGO_CMD_PREFIX
to link with our custom postgres build when building.Important: helm charts set LD_LIBRARY_PATH to point to a v16 path -- because we'll be building binaries against v15 (because that's what's available on debian bookworm), that might not work seamlessly, we might need to coordinate a helm chart change deploy with this change.
Why is it okay to only use statically-linked openssl for our other binaries and not for the storage controller? Because the purpose of that static linking is to make our postgres builds agnostic wrt the specific openssl version on the distro where we run. The controller doesn't need that, because it can use a totally vanilla upstream postgres for its client library, and that vanilla system postgres package will already use whichever openssl is available on the distro where we're running.