Merge pull request #2166 from pikasTech/docs/363-p0-postmortem
docs: 完成 AgentRun 逆序发布事故复盘
This commit is contained in:
@@ -124,9 +124,9 @@
|
||||
### R5.9 [in_progress]
|
||||
|
||||
解决 [AgentRun #356](https://github.com/pikasTech/agentrun/issues/356):修复 runner Job 已不存在且 lease 过期后,非终态 active turn admission 仍以 `session-turn-admission-active` 阻塞同 session `send`;按既有 SPEC 在 memory/PostgreSQL authority 内原子终结或隔离陈旧 admission 并创建新 run/turn/runner,保留 fresh active steer/并发拒绝,不新增第二 session authority、租约、围栏或客户端 retry,并与 PikaOA MVP 并行且不作为业务门禁,完成任务后将详细报告写入[任务报告](./details/agentrun-runtime-reliability/R5.9_Task_Report.md)。
|
||||
### R5.10 [in_progress]
|
||||
### R5.10 [completed]
|
||||
|
||||
解决 [AgentRun #363](https://github.com/pikasTech/agentrun/issues/363):旧 PipelineRun 在新 revision 已发布后才解除 admission 排队并把 `nc01-v0.2-gitops` 回退到旧 sourceCommit,导致 Artificer 重新加载已删除的 `sub2api` AipodSpec;PaC promote 必须以 source branch 最新 revision 为 authority,把过期运行处理为 `warning=true`、`blocking=false`、成功 no-op,禁止覆盖更新 GitOps,并通过自动 PaC 恢复 pika/grok AipodSpec。禁止手工 PipelineRun、Argo sync、runtime patch、数据库修改、第二 authority或 fallback,完成任务后将详细报告写入[任务报告](./details/agentrun-runtime-reliability/R5.10_Task_Report.md)。
|
||||
解决 [AgentRun #363](https://github.com/pikasTech/agentrun/issues/363):旧 PipelineRun 在新 revision 已发布后才解除 admission 排队并把 `nc01-v0.2-gitops` 回退到旧 sourceCommit,导致 Artificer 重新加载已删除的 `sub2api` AipodSpec;PaC promote 必须以 source branch 最新 revision 为 authority,把过期运行处理为 `warning=true`、`blocking=false`、成功 no-op,禁止覆盖更新 GitOps,并通过自动 PaC 恢复 pika/grok AipodSpec。禁止人工 PipelineRun、Argo sync、数据库修改、第二 authority或 fallback;调试 patch 只允许按 `$unidesk-daddev` P2 最小可逆执行,终态必须由 owning YAML/源码和自动 CI/CD 收敛,完成任务后将详细报告写入[任务报告](./details/agentrun-runtime-reliability/R5.10_Task_Report.md)。
|
||||
|
||||
## R6 [completed]
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# R5.10 P0 事故复盘
|
||||
|
||||
## 结论
|
||||
|
||||
本次事故不是生产 lane writer 修改开发环境,也不是数据库迁移依赖。真正根因是一个此前被 admission 阻塞的旧 AgentRun PaC PipelineRun,在较新 `b258520` 已成功发布后才开始执行,并以较新的 GitOps commit 为父提交,把 `sourceCommit` 逆序写回旧值 `0ca2c73`。Argo 正常同步了错误 desired,manager 因此重新加载旧 `sub2api` Artificer AipodSpec,新任务在 admission 阶段失败。
|
||||
|
||||
## 影响
|
||||
|
||||
- NC01/nc01-v02 manager desired 与源码 `v0.2` 分叉。
|
||||
- Artificer 从 `gpt-pika/grok` 回退到已删除的 `sub2api` provider。
|
||||
- HWLAB 公网入口修复无法派单,主线被 CI/CD 运行面故障阻塞。
|
||||
- 两个重复的生产 lane writer 被停止;后续证据确认它们不是 `bc12e93` 的作者。
|
||||
|
||||
## 时间线
|
||||
|
||||
- 较新 PipelineRun `agentrun-nc01-v02-ci-b258520...` 成功,生成 GitOps `dba70ac`。
|
||||
- 旧 `agentrun-nc01-v02-ci-0ca2...` 在 admission 解除后延迟启动,生成父提交为 `dba70ac` 的 `bc12e93`,但把 sourceCommit 写回 `0ca2c73`。
|
||||
- PR [UniDesk #2157](https://github.com/pikasTech/unidesk/pull/2157) 与 [AgentRun #364](https://github.com/pikasTech/agentrun/pull/364) 加入 stale/divergent/unverifiable revision 成功 no-op 逻辑。
|
||||
- #364 的自动 PipelineRun 在 `place-scripts` init 阶段失败;共享 schema validator 与 Ajv 被明文嵌入,单步脚本约 172 KiB,init container 退出 255。
|
||||
- PR [UniDesk #2160](https://github.com/pikasTech/unidesk/pull/2160) 将内嵌载荷改为 renderer 侧 gzip/base64,脚本降至 79,395 bytes;[AgentRun #365](https://github.com/pikasTech/agentrun/pull/365) 更新 repo-owned source artifact。
|
||||
- #365 merge 自动产生 PipelineRun `agentrun-nc01-v02-ci-5d7ede...`,成功生成 GitOps `56b5f3ed...` 并滚动 manager。
|
||||
|
||||
## 根因与促成因素
|
||||
|
||||
- promotion 缺少 incoming revision 相对 source branch 与当前 GitOps desired 的 ancestry/新旧判定,旧任务可以覆盖新 desired。
|
||||
- admission 阻塞把旧任务延迟到新任务之后执行,暴露了 PipelineRun 完成顺序不等于 source revision 顺序。
|
||||
- schema warning-only 实现把完整依赖明文嵌入 Tekton step,缺少对 place-scripts 载荷尺寸的运行面约束验证。
|
||||
- PaC `status/history/debug-step` 间歇性空 stdout,增加了定位成本;该可见性缺口由 [UniDesk #2165](https://github.com/pikasTech/unidesk/issues/2165) 独立跟踪,不改变交付 authority。
|
||||
|
||||
## 修复
|
||||
|
||||
- incoming revision 已过期、分叉或相对当前 desired 无法验证时,PipelineRun 保持成功终态、输出 `blocking=false` warning,并保留现有 GitOps commit。
|
||||
- ancestry 判断只使用 source clone 已有 refs 与当前 GitOps `source.json`,不增加第二 authority 或额外网络 fetch。
|
||||
- validator/Ajv 由 renderer 预压缩,运行时解压到有界临时文件;schema 与 OTel 失败仍只产生 warning,业务发布继续。
|
||||
- 全部恢复只由正常 PR merge 的 GitHub webhook -> Gitea -> PaC -> Tekton -> GitOps/Argo 自动链完成;未执行人工 PipelineRun、mirror sync、Argo sync、runtime patch 或数据库操作。
|
||||
|
||||
## 验证
|
||||
|
||||
- schema stage 定向 Bun 测试:5 pass,0 fail;未运行 Vitest。
|
||||
- AgentRun source artifact:aligned=true、provenance=true;生成 YAML 可解析,`gitops-promote` 脚本 `sh -n` 通过。
|
||||
- 自动 PipelineRun `agentrun-nc01-v02-ci-5d7ede...`:Succeeded。
|
||||
- GitOps commit:`56b5f3ed00f28b04e47f2e9baf3792d745d2a375`。
|
||||
- manager Deployment `AGENTRUN_SOURCE_COMMIT=5d7ede07543d6f8d9924ce9853420a4c6051eabd`,新 Pod ready。
|
||||
- `agentrun describe aipodspec/Artificer`:lane=`v0.2`、profile=`gpt-pika`、provider=`NC01`、model=`gpt-5.6-sol`,provider SecretRefs 为 `gpt-pika` 与 `grok`,旧 `sub2api` 已消失。
|
||||
|
||||
## 长期判定
|
||||
|
||||
- PipelineRun 的 source revision 决定新旧,排队与完成时间不能成为 desired authority。
|
||||
- runtime patch 可按 `$unidesk-daddev` P2 用于调试或临时恢复,但不能冒充终态;本事故未使用 patch,终态已由正常自动链收敛。
|
||||
- CI/CD 校验继续 warning-only,不得因 schema/OTel 漂移关闭功能或阻塞滚动。
|
||||
Reference in New Issue
Block a user