BReg: retry a refused first database connection in one-shot operations
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 crates/registry-breg/src/postgres/interlock.rs 中的 connect_dedicated 开始,阅读一次性命令(status、doctor、plan、apply、instance-claim)如何调用它,以及 sqlx 连接错误如何暴露被拒绝/不可达的连接。选择一个有界时间窗口(issue 建议 10 s),并且只重试在任何语句发送之前引发的错误。一个测试:首次连接被拒绝时会重试,而语句执行中途的失败不会重试,这就是“done”的样子;注意 issue 将基于 chart 的 Option 2 保持开放,所以在写代码之前先确认方案。
由索引模型根据 Issue 内容生成。
描述
Operation Jobs in the Helm chart run one attempt (backoffLimit: 0), so the operator's reconcile-first refusal decides what happens next rather than a Kubernetes retry. With one attempt, a failed first database connection fails the whole operation, and the operator has to rerun it.
On a single-server K3s install, a newly started Pod labelled registrystack.org/database-client: "true" got Connection refused from PostgreSQL for about 600 ms before its first successful TCP connection. The K3s network policy controller admits a new Pod's address shortly after the container starts. No BReg Job failed in that run, probably because the stage-operation-inputs init container delays the bregctl container. That margin is a matter of timing, not something the design guarantees.
status and the maintenance interlock connect through connect_dedicated in crates/registry-breg/src/postgres/interlock.rs, which makes one attempt and has no retry.
Options:
- Give the one-shot maintenance commands (
status,doctor,plan,apply,instance-claim) a short bounded retry, for example up to 10 s, that covers only connection refused or unreachable before any statement is sent. Nothing has changed in the database at that point, so the retry cannot repeat work. - Add a wait for the database port to the operation Job's init container. This stays in the chart and covers only Kubernetes installs.
Option 1 also helps any other orchestrator that starts a fresh process next to a fresh network policy.
- 主要语言
- Rust
- 星标
- 2
- 派生
- 0
- 平均合并
- 9 小时 48 分钟
- 30 天内合并 PR
- 151
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
registrystack/registry-stack 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
registrystack/registry-stack#2761 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
registrystack/registry-stack#2743 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
registrystack/registry-stack#2706 ·
维护者通常 1 天内回复
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directory未关闭
难度 2/5 1-3 小时 新手友好度 83/100
registrystack/registry-stack#2704 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
registrystack/registry-stack#2698 ·
维护者通常 1 天内回复
查看 registrystack/registry-stack 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1 小时以内 新手友好度 82/100
stackabletech/airflow-operator#898 ·
维护者通常 1 天内回复
-
2 advisory ignore entries no longer match anything (`bytes`, `time` already patched in `Cargo.lock`)可能已有人在做 @zyl71 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100