Commit 110230d
* docs(spec): cache warmer herd mitigation design (#59)
A1 (jitter) + A2 (baseline delay) + A3 (paced batched warmup) + B2b
(N-slot PG advisory-lock semaphore with wait-on-miss) for the cluster-
wide inter-pod warmer stampede observed on rolling deploys.
Six new config knobs (cache-warm-delay/-jitter/-concurrency/-wait-max/
-batch-size/-batch-pause) with conservative defaults. Reuses the
session-level advisory lock pattern from startup_locks.py for slot
allocation. Last-pod latency analysis included.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(plan): implementation plan for #59 herd mitigation
Bite-sized TDD-ordered tasks (14 total) covering: kwarg extension,
A2+A1 delay/jitter, A3 batched warmup, B2b advisory-lock semaphore
helpers (try-once, retry-loop, release), warm() integration, storage
wiring, ZConfig keys, three DB integration tests, CHANGES entry, full
test + lint pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): add six herd-mitigation kwargs (off defaults) (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): A2+A1 — startup delay + jitter sleep (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): A3 — paced batched warmup (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): B2b — _try_acquire_slot_once helper (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): B2b — _acquire_slot with retry loop and wait cap (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): B2b — _release_slot helper (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(warmer): B2b — integrate slot lifecycle into warm() (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(storage): wire herd-mitigation knobs into CacheWarmer (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(config): six ZConfig keys for cache-warm herd mitigation (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(warmer): DB integration tests for B2b semaphore (#59)
- concurrency=1 serializes two warmers
- concurrency=2 allows two parallel, third waits
- crash-safe slot release on connection close
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: changelog entry for cache warmer herd mitigation (#59)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style: ruff format + lint after herd-mitigation changes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(warmer): code review fixes (#59)
- close lock connection on slot acquisition timeout (was leaking)
- continue scanning remaining slots when single-slot try_lock raises
(was halting prematurely, deviating from spec)
- use fresh psycopg connection per warmer thread in DB integration
tests (psycopg connections are not thread-safe)
- assert lock_conn.close() called on timeout path in unit test
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 51ed12b commit 110230d
9 files changed
Lines changed: 3210 additions & 29 deletions
File tree
- docs/superpowers
- plans
- specs
- src/zodb_pgjsonb
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
3 | 41 | | |
4 | 42 | | |
5 | 43 | | |
| |||
0 commit comments