vr-shopxo-plugin/plan.md

70 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Plan — Round 2 Performance Evaluation (2026-05-26)
> Agent: council/PerformanceBenchmarker
## Phase: Draft → Review → Finalize
---
## 评估任务清单
- [x] **Task 1**: [Done: PerformanceBenchmarker] 检查 git log 和文件结构
- [x] **Task 2**: [Done: PerformanceBenchmarker] 探索 SeatMapService + seatmap API + SKIP LOCKED 实现
- [x] **Task 3**: [Done: PerformanceBenchmarker] 输出 Round 1 性能评估报告
- [x] **Task 4**: [Done: PerformanceBenchmarker] Round 2代码实测验证 + 交叉审查其他成员报告
- [x] **Task 5**: [Pending] 等待西莉雅汇总最终报告
---
## 阶段划分
| 阶段 | 内容 | 状态 |
|------|------|------|
| **Draft** | Task 1-3独立评估 Round 1 | ✅ 完成 |
| **Review** | Task 4代码实测 + 交叉审查) | ✅ 完成 |
| **Finalize** | 西莉雅汇总所有成员报告 | ⏳ 等待西莉雅 |
---
## 依赖关系
- 本轮评估无对其他成员的依赖,可独立完成
- 最终综合报告由西莉雅(协调者)负责
---
## 投票结果
**议题:下一步主攻方向**
- 投票:**C双线并行**Round 1 + Round 2 一致)
详见 `docs/council-eval-performancebenchmark.md`
---
## 关键发现摘要Round 2 修正版)
| # | 严重程度 | 问题 | 量化 |
|---|----------|------|------|
| P1-R2 | 🔴 严重 | seatmap API 全量扫描无缓存过滤 | 500 并发 = 2.5 GB/s |
| P2-R2 | 🟡 高 | `SeatSkuService::getSoldSeats()` 方法缺失(与 BackendArchitect P0-1 双重确认) | soldSeats stub |
| P3-R2 | 🟡 高 | 无细粒度差量轮询 API所有用户全量拉取 | 500 并发 = 2500 DB SELECT/s |
| P4-R2 | 🟡 高 | inventory > 0 vs =0 两套逻辑不一致 | 状态不一致窗口 |
| P5-R2 | 🟢 中 | verifyTicket() 无 SKIP LOCKED | 低频,优化非必须 |
| P6-R2 | 🟢 中 | onOrderPaid 无事务包装 | P2SecurityEngineer 已评) |
**超卖归因修正Round 2 关键)**
- ShopXO `dec()` 原子条件 UPDATE = 主要防线,不需要 FOR UPDATE SKIP LOCKED
- issueTicket() TOCTOU = P1-suggestion唯一索引修复非 P0
- verifyTicket() = 已有 `lock(true)`SKIP LOCKED 是优化非必须
---
## 优先级建议(基于修正后 P 表)
1. **P0**:添加 `(goods_id, inventory, id)` 复合索引 → 消除全量扫描
2. **P0**`SeatSkuService::getSoldSeats()` 实现 → 解锁 soldSeats API
3. **P1**:新增 `GET /seatmap/delta` 差量轮询 API → 降低 80% 带宽和 DB QPS
4. **P1**:加唯一索引 `(order_id, seat_info)`SecurityEngineer 建议)
5. **P2**Phase 4 Tree API 实现