test(perf): chaos kill-matrix gate + cache/rerank degrade-open + LitmusChaos (Step 7.2) - #165
Merged
Conversation
…usChaos (Step 7.2) Extend the Step 7.1 chaos gate from the three retrieval backends to the full hot-path set: kill each backend in turn (100% unavailable) behind the real breakers + fallback and assert no single failure 5xx-es the gateway. The matrix exposed two real 5xx holes — a down retrieval cache and reranker — now closed with minimal degrade-open guards (cache outage -> miss; reranker outage -> retrieval-only, honouring RerankPipeline's "caller decides" contract). The LLM and embedder already degraded. Ships the in-process kill-matrix harness + perf gate (task chaos-kill), the LitmusChaos cluster manifests (infra/chaos/: gateway pod-delete + backend network-loss/latency with httpProbe acceptance) as the runbook, ADR-0044, and the chaos-engineering guide. No dist/, SPI, config, or registered-event change. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Step 7.2 — Chaos engineering: kill each backend, verify the fallback chain holds. Extends the Step 7.1 chaos gate from the three retrieval backends to the full hot-path backend set and proves the GA resilience bar — no single backend failure can 5xx the gateway.
eval/gateway_chaos_v0/kill_matrix.py+tests/perf/test_chaos_kill_matrix.py,task chaos-kill) — kills each ofvector / keyword / graph / embedder / retrieval_cache / reranker / llmin turn (100% unavailable) behind the real Phase-4 breakers + fallback, drives/v1/query, and asserts no 5xx, 100% success, the on-path retrieval breaker opens, and the expected degraded shape. A seeded keyword corpus + the store's realhydratemake rerank/pack/generate actually run, so every kill exercises a genuine degrade path. Timing-independent → deterministic in theperfCI job.gateway.cache.degraded, on/v1/query+/v1/retrieve)gateway.rerank.degraded, honouringRerankPipeline's documented "caller decides" contract)RetrievalRouter.decideneeds caller seeds) — its kill is survivable by construction, recorded honestly rather than forcing a synthetic query.infra/chaos/) — gatewaypod-delete+ backendpod-network-loss/pod-network-latencywith an embedded httpProbe asserting the gateway stays 200 throughout. Topology-bound, so a runbook, not a CI gate (same split as the 7.1 load runbook).No
dist/, SPI, config, or registered-event change (degrade kinds are log-only likegateway.answer.failed; the kill wrappers are pure-raise → no policy-coverage rule needed).Verification
Empirical kill-matrix run — all seven survive with the expected degraded shape:
Documentation
docs/adr/ADR-0044-chaos-engineering.md— the decision (kill-matrix gate, the two hardenings, cluster runbook, alternatives).docs/guides/chaos-engineering.md— the runbook (in-process gate + LitmusChaos).docs/reference/perf.md— kill-matrix section.infra/chaos/README.md— operator runbook for the manifests.docs/README.md— index rows.TRACKER.md— 7.2 ✅, Phase 7 2/10 (76/84), next: 7.3.Test plan
pytest -m perf tests/perf/test_chaos_kill_matrix.py— 12 tests greenpytest -m perf tests/perf/— full perf suite (incl. 7.1 chaos gate) greenpytest apps/gateway/tests/— 310 tests, no regressionstask chaos-kill→ PASS (all 7 backends survive)🤖 Generated with Claude Code