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
..
2026-07-10 11:59:24 +08:00
2026-07-03 22:04:39 +08:00
2026-07-03 22:04:39 +08:00
2026-07-10 11:25:22 +08:00
2026-07-10 16:32:04 +08:00
2026-07-04 01:53:10 +08:00
2026-06-23 11:53:00 +08:00
2026-07-09 13:02:49 +08:00
2026-07-10 16:10:57 +08:00
2026-07-09 18:15:57 +08:00
2026-07-09 18:15:57 +08:00