Files
supply-intelligence/tech/GRAYSCALE_ROLLOUT_PLAN_2026-05-10.md
2026-05-12 18:49:52 +08:00

159 lines
4.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Supply-Intelligence 灰度放量执行计划2026-05-10
状态:待执行
仓库:`/home/long/project/supply-intelligence`
前提QA 报告 CONDITIONAL_APPROVED上线前检查清单已通过
---
## 0. 灰度策略总览
supply-intelligence 采用 **account 级灰度**,通过控制 `AccountRoutingState.RoutingEnabled``SupplyAccount.ConsumerTag` 实现逐步放量。
灰度阶段:
1. 影子运行0% account只验证服务存活
2. 单 account 验证1 个测试 account
3. 小批量放量10% active accounts
4. 半量放量50% active accounts
5. 全量放行100% active accounts
---
## 1. 影子运行Shadow / 0% Account
目标:验证服务部署后无 panic、无异常日志、metrics 正常。
执行步骤:
```bash
# 1. 部署到目标环境(并入 supply-api 主仓或独立实例)
# 2. 不启用任何 account 的 routing_enabled
# 3. 仅执行健康检查和 metrics 抓取
curl -fsS http://<BASE_URL>/healthz
curl -fsS http://<BASE_URL>/metrics | grep supply_intelligence_
```
观察窗口5 分钟
通过标准:
- healthz 返回 200
- metrics 正常暴露无 panic
- 无 ERROR/FATAL 日志
---
## 2. 单 Account 验证1 Account
目标:验证完整业务链路在真实环境下可行。
执行步骤:
```bash
# 1. 选择一个测试 account建议非生产关键 account
# 2. 插入 test-passed candidate + draft package
# 3. 执行完整链路
BASE_URL="<BASE_URL>" PLATFORM="openai" MODEL="<test-model>" EVENT_ID="evt-gray-1" \
bash scripts/gateway_closure_smoke.sh
```
验证要点:
- publish 返回 candidate=published, package=active
- consume-once 返回 event=applied
- admission-state 返回 gateway_sync_status=applied
- inspect 返回 decision=continue
观察窗口10 分钟
通过标准:链路完整闭环,无 failed 事件。
---
## 3. 小批量放量10% Active Accounts
目标:验证多 account 并发下无异常。
执行步骤:
```bash
# 1. 选取 10% 的 active accounts设置 routing_enabled=true
# 2. 观察 10 分钟
# 3. 执行 inspect 脚本,确认指标正常
BASE_URL="<BASE_URL>" CONSUMER="gateway" bash scripts/gateway_closure_inspect.sh
```
关键指标:
- `gateway_events_processed_total` 增长与 publish 频率匹配
- `gateway_event_latency_seconds` P99 < 1s
- `gateway_pending_retry_events` < 5
- `gateway_failed_events` = 0
观察窗口10 分钟
通过标准:所有关键指标在基线范围内。
---
## 4. 半量放量50% Active Accounts
目标:验证中等负载下稳定性。
执行步骤:
- 逐步放开至 50% active accounts
- 每批放量后执行 inspect
- 观察 latency 和 error rate
关键指标:
- 同上,但 latency P99 容忍度放宽至 < 2s
观察窗口30 分钟
通过标准无告警触发inspect 决策为 continue。
---
## 5. 全量放行100% Active Accounts
目标:所有 active accounts 启用 supply-intelligence 路由。
执行步骤:
- 放开全部 active accounts
- 启动 24h/72h/首周巡检(见 `PRODUCTION_OBSERVABILITY_CHECKLIST`
---
## 6. 止损条件(任意阶段触发即回滚)
| 条件 | 触发值 | 动作 |
|------|--------|------|
| healthz 连续失败 | 3 次 | 立即 pause runtime |
| gateway 失败率 | > 10% | 执行 rollback 脚本 |
| pending retry 积压 | > 50 | 暂停放量,排查 consumer |
| latency P99 | > 5s | 降级至上一阶段比例 |
| panic / fatal 日志 | > 0 | 全量回滚 |
回滚命令:
```bash
curl -X POST "<BASE_URL>/internal/supply-intelligence/gateway/runtime/pause"
```
---
## 7. 执行决策点
需要确认:
1. **部署目标**:并入 supply-api 主仓 / tksea 独立实例 / 其他环境
2. **BASE_URL**:灰度环境的实际访问地址
3. **测试 account**:单 account 验证时使用的 account ID
4. **放量节奏**:每阶段观察窗口时长(默认按本计划)
5. **值班人**:各阶段执行人和紧急联系人
---
## 8. 本地预验证已完成项
| 阶段 | 状态 | 证据 |
|------|------|------|
| 影子运行 | ✅ | healthz=200, metrics 正常 |
| 单 account | ✅ | smoke 脚本通过decision=continue |
| 回滚脚本 | ✅ | rollback.sh 语法通过pause/resume API 可用 |
---
版本v1.0 | 创建2026-05-10