docs(breg): state that the migration role must not hold CREATE on the database in Provision PostgreSQL
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- postgresql
調査の方向性
docs/site/src/content/docs/operate/breg.mdx の “Provision PostgreSQL” セクションを読み、ロールに関する説明を crates/registry-breg/src/postgres/roles.rs の verify_migration_role と比較してください。メインセクションを更新し、マイグレーションロールがデータベースの所有者であってはならず、データベースで CREATE 権限を持ってはならないことを明記し、関連する根拠コメントを追加してください。空間機能を使わないセットアップの読者がこの要件を確認でき、記載されたロール権限が強制処理と一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
docs/site/src/content/docs/operate/breg.mdx, section "Provision PostgreSQL", never says that the migration role must not hold CREATE on the database, and must not own the database (an owner holds CREATE implicitly). The main block revokes database privileges from PUBLIC only (REVOKE ALL ON DATABASE registry FROM PUBLIC;); the only revoke that names the registry roles is REVOKE CREATE ON DATABASE registry FROM PUBLIC, registry_migration, registry_runtime; inside the spatial subsection, so a reader of a non-spatial project has no reason to check it. PostgreSQL does not grant database CREATE to PUBLIC by default, so the risk is an explicit grant or ownership the administrator's own tooling adds (for example CREATE DATABASE registry OWNER registry_migration, or a hosted provider's setup script).
Where
- Docs:
docs/site/src/content/docs/operate/breg.mdx, "Provision PostgreSQL" (lines 140 to 201 on origin/main; identical onjeremi/documents). - Enforcement:
crates/registry-breg/src/postgres/roles.rs,verify_migration_role(lines 401 to 431 on origin/main). It refuses whenhas_database_privilege(current_user, current_database(), 'CREATE')is true, as it does for SUPERUSER, BYPASSRLS, CREATEDB and CREATEROLE, withRoleInvariant("migration role has database-level administrative authority"). The same function then requires the migration role to own all five managed schemas (verify_schema_owner). - It runs on every apply connection (
interlock.rs,acquire_inner, line 286), in schema preparation forbregctl test(schema.rs), and in the maintenance commands.
What goes wrong
The refusal is correct and happens before maintenance, so nothing is written. But the operator is not told why:
bregctl applyandbregctl planreportapply.migration.failedwith "requires exact-target reconciliation" and suggested actionreconcile-failed-migration(see #1381), which sends them tomigration reconcilefor a database that was never touched.bregctl testmost likely reportstest.database.unavailable("recreate the disposable database"), becauseschema_preparation_errorincrates/registry-bregctl/src/test_lifecycle.rscollapses every otherStartupErrortoTestLifecycleError::Database. I did not trace theRoleInvarianttoStartupErrormapping for this exact case.
During the 2026-10-22 root-cause investigation, the repro databases gave the migration role CREATE on the database and lacked the five managed schemas; the documented setup passed with v0.43.0.
Proposed direction
In the main "Provision PostgreSQL" text (not only the spatial block):
- One sentence: the migration role must not own the database or hold CREATE on it; it owns only the five schemas, and
testandapplyrefuse a role with database-level authority. - Optionally add
REVOKE CREATE ON DATABASE registry FROM registry_migration, registry_runtime;to the main block, so the spatial block's revoke is not the only one. - Add
crates/registry-breg/src/postgres/roles.rs, verify_migration_roleto the Evidence comment.
Notes
- Confirmed in code: the CREATE refusal, its message, where it runs, and the docs text on origin/main.
- From the triage notes, not reproduced by me: the repro databases' exact grants.
- Inferred: the
bregctl testcode for this case. - The misleading apply code is #1381; this issue is docs only.
- 主要言語
- Rust
- スター
- 2
- フォーク
- 0
- 平均マージ
- 9時間 43分
- マージ済み PR(30日)
- 268
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
registrystack/registry-stack のほかの issue
-
test(breg): postgres_startup needs the tooling feature its required-features does not declare対応中かも @jeremi が 1 日前に担当しました。 オープンarea:breg bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
registrystack/registry-stack#2307 ·
メンテナーはふだん 1 日以内に返信
-
area:docs documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
registrystack/registry-stack#2253 ·
メンテナーはふだん 1 日以内に返信
-
area:coordinator bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
registrystack/registry-stack#2252 ·
メンテナーはふだん 1 日以内に返信
-
area:release bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
registrystack/registry-stack#2248 ·
メンテナーはふだん 1 日以内に返信
-
area:breg documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
registrystack/registry-stack#2233 ·
メンテナーはふだん 1 日以内に返信
registrystack/registry-stack の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
dsx-ai-factory/infra-controller#8145 ·
メンテナーはふだん 1 日以内に返信
-
bug: workspace access hint suggests a --subject command that fails for hyphen-leading OIDC subjectsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
A-FFI C-Testing D-Straightforward S-Ready
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信