Repository navigation
feat(multigres): add the multigres_probe role to the image - #2638
niconosenzo wants to merge 1 commit into
Conversation
e646569 to
261fa0a
Compare
Package version diffCompares built package versions in legacyPackages between this PR and the tip of the base branch, per system. aarch64-linux: Closure size: 372 -> 372 (2 paths added, 2 paths removed, delta +0, disk usage +16B).x86_64-linux: Closure size: 370 -> 370 (2 paths added, 2 paths removed, delta +0, disk usage +16B). |
64029c6 to
592b261
Compare
|
Found 57 test failures on Blacksmith runners: Failures
...and 47 more test failures. View all on Blacksmith
|
brainrake
left a comment
There was a problem hiding this comment.
The role attributes are only applied when the role does not exist yet. See the inline suggestions.
multigres_probe has no explicit grants, but it keeps default PUBLIC privileges and can connect to any database. Loopback is trust in pg_hba.conf.j2, so any local client can log in as it. Confirm that is correct in terms of security.
No test covers the role attributes or the reservation.
PostgreSQL Extension Dependency Analysis: PR #2638
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesExtension: pg_cron
Raw Dependency TreeExtension: pg_repack
Raw Dependency TreeExtension: postgis
Raw Dependency TreeExtension: wrappers
Raw Dependency TreePostgreSQL 17 Extension DependenciesExtension: pg_cron
Raw Dependency TreeExtension: pg_repack
Raw Dependency TreeExtension: postgis
Raw Dependency TreeExtension: wrappers
Raw Dependency TreeOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2638
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
cb59838 to
e2ee9cf
Compare
On pg_hba: Multigres clusters don't use the j2 file. pgctld renders its own Regarding PUBLIC: you're right, it gets the same floor as any login role. I checked on a running Multigres image and PUBLIC holds CONNECT and TEMP on the database and USAGE (not CREATE) on schema public. So, what that means for the probe:
The only explicit grant it will get is SELECT on multigres.heartbeat, applied by multipooler. |
| # Regenerate manifest after orioledb added 00-pre-init.sql to init-scripts/ | ||
| # (same role notes as the variant-17 manifest above). |
There was a problem hiding this comment.
Same file as the variant-17 stage. Drops the pointer comment.
| # Regenerate manifest after orioledb added 00-pre-init.sql to init-scripts/ | |
| # (same role notes as the variant-17 manifest above). | |
| COPY --chown=postgres:postgres docker/pgctld/multigres-roles.sql /docker-entrypoint-initdb.d/multigres-roles.sql | |
| # Regenerate manifest after orioledb added 00-pre-init.sql to init-scripts/ |
Multigres uses multigres_probe to check that a cluster answers a query over the normal client path. The init manifest creates it from docker/pgctld/multigres-roles.sql, which the variant-17 and orioledb stages both include. The role has LOGIN, NOBYPASSRLS, CONNECTION LIMIT 2 and a 2s statement_timeout. An unconditional ALTER ROLE sets them, so a role that already exists cannot keep other attributes. The image sets no password. The deployment sets one after boot. Reserve the name in the shared supautils.reserved_roles list, not only on the Multigres image, so no Supabase Postgres build lets a customer create a role with that name. Test the reservation in supautils_reserved_roles and the role attributes in the Multigres image test.
e2ee9cf to
251c28c
Compare
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Create multigres_probe in the Multigres init manifest, next to the postgres role: LOGIN, NOBYPASSRLS, CONNECTION LIMIT 2, statement_timeout 2s, no password and no grants. Multigres uses it to check that a cluster can answer a query over the normal client path; multipooler grants it read access to multigres.heartbeat and nothing else.
Move the reservation out of the Multigres image and into the shared supautils.reserved_roles list, next to the other Supabase roles. The Dockerfile sed only reserved the name on the Multigres builds. Keeping it in the one list means every Supabase Postgres build reserves it, so a database moving between Supabase offerings never has a window where a customer role could claim the name. The role itself is still only created on the Multigres images.