Repository navigation
Run a pooler in front of every PostgresDatabase, and sign the program in as its own role - #113
Merged
Merged
Conversation
… in as its own role A PostgresDatabase now runs PgBouncer in session mode inside its unit, so clients past the connections Postgres serves wait their turn instead of being refused. Every client signs in as the role `app`, which owns the database and is no superuser; existing databases are converted on their next start. Postgres closes an `app` session idle for a minute, watching queries lift that limit for their own session, and the worker pool closes connections idle for five seconds. Any existing database name keeps working: a name PgBouncer cannot read as written gets a door name the connection carries. A new `extensions` setting makes each listed extension as the superuser on every start. A new database needs Postgres 14 or later; an existing older one keeps running, with a warning through the new InfraSpec `notes` and on its card. Also: a stopping worker lets go of what its runs shared; Cloud Run removes a program's revisions under settings other than the stored ones after a settings change or activation; infra and trigger setup failures, and a rebake's, carry the reason; a failing health check's body is shown in `weft infra status`; the fake node-test rig holds a publish to the access store's check, against recipes resolved over the whole catalog; and the CLI test fake keeps a closed port reserved so parallel tests cannot take it.
# Conflicts: # CHANGELOG.md # crates/weft-dispatcher/src/api/project.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A PostgresDatabase no longer runs out of connections when the program scales. It now runs PgBouncer, in session mode, inside its own unit. A client that finds every connection busy waits for one instead of being refused, and one firing still keeps one real session.
What breaks for people who update
appinstead ofweft. The password, host and port are the same, andweft infra envwrites the new user.extensionssetting.What else changes
The database:
appis created and given ownership of everything the superuser owned.weft infra statusthrough the newInfraSpec.notes.PGDATABASE, so a name containing=is read as a name./health.The Postgres nodes:
The rest of weft:
weft infra status.Tests run locally
ci.ymlanddocs.ymlrun passes.my-appis carried over with its rows.