
zycandClaude Fable 5
2fcd6d996c
fix(deploy): migrate 跨 pod 串行化 + rescale 迁移幂等守卫(测试环境×10⁶事故复盘)
事故:连推 3 commit 触发 3 轮 rolling 部署,多个新 pod 并发跑 migrate 且崩溃重跑,
积分 ×10 rescale 被交错重放——ai.0025 执行 6 次(单价/任务计价 ×10⁶),accounts.0008
执行 2 次(限额 ×100),billing.0003/0004 从未完成(django_migrations 漏记录)。
测试库数据已按精确倍率手工修复并补记迁移记录(备份于本机)。
两层防复发:
1. docker-entrypoint 用 MySQL GET_LOCK('airshelf_migrate') 串行化 migrate,
后到 pod 等锁,拿到时迁移已被记录 → 自然 no-op;
2. 三个 rescale 迁移加 airshelf_rescale_marker 幂等标记(与数据变更同事务提交):
记录丢失/崩溃重跑时,标记在 → 跳过,不会重复 ×10。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 11:25:40 +08:00
..
2026-06-05 10:21:40 +08:00
2026-06-05 10:21:40 +08:00
2026-06-05 10:21:40 +08:00
2026-06-15 10:06:15 +08:00
2026-06-15 10:06:15 +08:00
2026-06-17 03:12:03 +08:00
2026-06-17 03:21:06 +08:00
2026-06-18 18:15:34 +08:00
2026-06-19 04:18:30 +08:00
2026-06-19 21:52:41 +08:00
2026-06-19 22:45:14 +08:00
2026-06-22 23:15:11 +08:00
2026-06-23 03:19:07 +08:00
2026-06-23 03:19:07 +08:00
2026-06-23 18:05:27 +08:00
2026-06-24 00:56:33 +08:00
2026-06-24 00:56:33 +08:00
2026-06-25 12:00:03 +08:00
2026-06-25 12:00:03 +08:00
2026-06-27 14:00:28 +08:00
2026-06-27 18:26:16 +08:00
2026-06-27 18:27:15 +08:00
2026-07-06 10:58:36 +08:00
2026-07-06 10:58:36 +08:00
2026-07-07 10:04:00 +08:00
2026-07-07 11:25:40 +08:00