zhx
|
551ad9b03a
|
fix: lucky_gift_outbox delivered 保留期收紧为 7 天
线上实测 delivered 约 9 万行/天且该表无下游读方(事实在 lucky_draw_records),
30 天窗口会让表膨胀到近 300 万行;7 天足够排障。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-10 16:42:30 +08:00 |
|
zhx
|
79e60f3815
|
fix: lucky_gift_outbox 抢占改单 status + SKIP LOCKED,补 delivered 保留期清理
- ClaimPendingLuckyGiftOutbox 把 status IN ('pending','retryable') 拆成单
status 查询并加 FOR UPDATE SKIP LOCKED:IN 跨 status 会 filesort 全部匹配行
并逐行加锁,积压时两实例互相阻塞(参照 chatapp3-golang 523cfe9 的修法);
ORDER BY 对齐 idx_lucky_gift_outbox_claim_retry/claim_lock 列序,索引序扫描
LIMIT 提前终止,只锁认领行。pending 留 10% 批次额度给 retryable 防饿死。
- 新增 delivered 行保留期清理 worker(默认开启,保留 30 天、5 分钟一轮、
单批 500):线上已积累 15.4 万只增不减的 delivered 行。清理按 app_code
迭代走 idx_lucky_gift_outbox_retention,只删 delivered 终态。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-10 16:32:04 +08:00 |
|
zhx
|
959ce54750
|
fix: 治理线上 MySQL CPU 波动的两个热点查询
- backfill-last7 的报表用户集合改从 wallet_accounts(7千行)取,
替代每10分钟对千万级 wallet_entries 做资产全量 DISTINCT 扫描
(线上等价性已核验:旧集合 4907 人 ⊆ 新集合 4908 人)
- lucky_gift_outbox 补两个无 app_code 前缀的 claim 索引,
消除 worker 每秒空轮询的全索引扫描+filesort(线上已手工应用)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-10 16:10:57 +08:00 |
|
zhx
|
68fc43d4b2
|
修复
|
2026-07-10 14:33:57 +08:00 |
|
zhx
|
ba35148c94
|
Fix lucky gift pool import upsert
|
2026-07-08 22:43:08 +08:00 |
|
zhx
|
c27947fd05
|
Fix lucky gift import migration database context
|
2026-07-08 22:41:36 +08:00 |
|
zhx
|
8affe63f6a
|
Split lucky gift service and ops center
|
2026-07-08 22:30:46 +08:00 |
|