docs: 记录 PK01 多数据库备份交付
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# R1.6.1.1 任务报告
|
||||
|
||||
## 结论
|
||||
|
||||
已实现 pikasTech/unidesk#2115,并提交 PR #2118。PK01 PostgreSQL 逻辑备份已从单个 Sub2API 特例正规化为 YAML-first `logicalDumps[]`;保留 Sub2API 既有 03:17 schedule、14 天 retention、目录与 systemd 资源语义,新增 PikaOA 独立 03:37 schedule、14 天 retention、脚本、service、timer 和目录。
|
||||
|
||||
任务保持 `in_progress`。本次按派单边界未执行真实 `apply` 或手动 dump,等待主代理审核后完成运行面 mutation 与验收。
|
||||
|
||||
## 变更
|
||||
|
||||
- `config/platform-db/postgres-pk01.yaml`:每项完整声明 database、scriptPath、serviceName、timerName、目录、schedule、retention、warningAfterHours、pgDump 参数和 encryption 状态。
|
||||
- `scripts/src/platform-db.ts`:按 YAML 解析、校验、生成远端 payload,动态渲染全部 dump 脚本与 systemd unit;删除 Sub2API 专用路径、unit、timer schedule 硬编码。
|
||||
- `scripts/src/platform-db-postgres-backups.ts`:集中生成每项备份的声明、timer、最近成功、最新非空 dump、可恢复性和 warning 投影。
|
||||
- `scripts/src/platform-db-postgres-backups.test.ts`:覆盖配置解析、renderer 去硬编码和 warning 非阻塞语义。
|
||||
|
||||
## Primary Workspace 轻量准备
|
||||
|
||||
Primary workspace 仅用于读取 `dad-dev`、`unidesk-ops`、`unidesk-ymalops`、`cli-spec`、`git-spec`、`unidesk-trans`、`unidesk-gh`、`mdtodo-edit` 与 `post-task` 技能;未在 runner 本地读取、编辑或验证目标源码,未把 runner 容器结果作为 Target 证据。
|
||||
|
||||
## Target 原入口证据
|
||||
|
||||
全部源码、Git、测试和运行面命令均通过 `trans NC01:/root/unidesk/.worktree/pikaoa-production-backup ...` 执行。
|
||||
|
||||
- `bun --check scripts/src/platform-db-postgres-backups.ts`:通过。
|
||||
- `bun --check scripts/src/platform-db.ts`:通过。
|
||||
- `bun test scripts/src/platform-db-postgres-backups.test.ts`:3 pass,0 fail。
|
||||
- 生成的远端 apply runner 经 `sh -n`:通过。
|
||||
- `git diff --check`:通过。
|
||||
- 只读 `platform-db postgres plan`:`ok=true`、`mutation=false`;Sub2API timer active/enabled,最近成功为 2026-07-15 03:17:01 CST,最新非空 dump 为 90,798,991 bytes,可恢复性为 true;PikaOA 未 apply,脚本/timer/最近成功/latest dump 缺失均只形成 warning。
|
||||
- 只读 `platform-db postgres status`:`ok=true`、`mutation=false`、`failure=null`;备份 warning 不阻塞 PikaOA MVP。
|
||||
|
||||
## Git 与 PR
|
||||
|
||||
- 分支:`feat/pikaoa-production-backup`。
|
||||
- 最新 master 已语义合入:merge commit `3086ea8d`。
|
||||
- 功能提交:`c483d6d508f5a9501f211d2b7bffd16a04494483`。
|
||||
- PR:pikasTech/unidesk#2118,关联 pikasTech/unidesk#2115,未合并。
|
||||
|
||||
## 风险与下一步
|
||||
|
||||
- PikaOA 的 systemd 资源与 dump 文件在 apply 前不存在,当前 warning 与预期一致。
|
||||
- 主代理审核后执行:
|
||||
1. `bun scripts/cli.ts platform-db postgres plan --config config/platform-db/postgres-pk01.yaml`
|
||||
2. `bun scripts/cli.ts platform-db postgres apply --config config/platform-db/postgres-pk01.yaml --confirm`
|
||||
3. 按异步 job 返回的 `statusCommand` 短轮询至完成。
|
||||
4. `bun scripts/cli.ts platform-db postgres status --config config/platform-db/postgres-pk01.yaml`
|
||||
5. `sudo systemctl start unidesk-pk01-pikaoa-pgdump.service`
|
||||
6. 再次执行 status,确认 PikaOA timer active/enabled、最近成功存在、最新非空 dump 大于 0 bytes、recoverable=true 且 warnings 为空。
|
||||
- 上述 mutation 与手动 dump 验收完成后,再将 MDTODO R1.6.1.1 标记 complete。
|
||||
Reference in New Issue
Block a user